With this change, all 5 images load concurrently, reducing total time to ~1 second.
Changed
Image loading in image_edits endpoint now uses asyncio.gather() for parallel execution
Fixed
Sequential image loading causing unnecessary latency in multi-image edit operations
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/20911
**Author:** [@sjhddh](https://github.com/sjhddh)
**Created:** 1/23/2026
**Status:** ✅ Merged
**Merged:** 1/27/2026
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `fix/images-parallel-loading`
---
### 📝 Commits (1)
- [`79486b6`](https://github.com/open-webui/open-webui/commit/79486b64c5c498656a43d40865e1a330eb61e247) perf: parallelize image loading in image_edits endpoint
### 📊 Changes
**1 file changed** (+2 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/routers/images.py` (+2 -1)
</details>
### 📄 Description
## Summary
Use `asyncio.gather()` to load multiple images concurrently in the `image_edits` endpoint instead of loading them sequentially.
## Problem
When editing multiple images, the current implementation loads them one by one:
```python
form_data.image = [await load_url_image(img) for img in form_data.image]
```
This means if you have 5 images that each take 1 second to load, the total time is 5 seconds.
## Solution
Use `asyncio.gather()` to load all images in parallel:
```python
form_data.image = list(await asyncio.gather(*[load_url_image(img) for img in form_data.image]))
```
With this change, all 5 images load concurrently, reducing total time to ~1 second.
### Changed
- Image loading in `image_edits` endpoint now uses `asyncio.gather()` for parallel execution
### Fixed
- Sequential image loading causing unnecessary latency in multi-image edit operations
---
### Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20911
Author: @sjhddh
Created: 1/23/2026
Status: ✅ Merged
Merged: 1/27/2026
Merged by: @tjbck
Base:
dev← Head:fix/images-parallel-loading📝 Commits (1)
79486b6perf: parallelize image loading in image_edits endpoint📊 Changes
1 file changed (+2 additions, -1 deletions)
View changed files
📝
backend/open_webui/routers/images.py(+2 -1)📄 Description
Summary
Use
asyncio.gather()to load multiple images concurrently in theimage_editsendpoint instead of loading them sequentially.Problem
When editing multiple images, the current implementation loads them one by one:
This means if you have 5 images that each take 1 second to load, the total time is 5 seconds.
Solution
Use
asyncio.gather()to load all images in parallel:With this change, all 5 images load concurrently, reducing total time to ~1 second.
Changed
image_editsendpoint now usesasyncio.gather()for parallel executionFixed
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.