This update fixes an incompatibility between open-webui and the gpt-image-1 image generation model. The gpt-image-1 model does not support the "response_format" parameter, which caused issues when generating images.
This ensures that an empty string is passed for the "response_format" parameter when using the gpt-image-1 model, and "b64_json" is used otherwise.
Impact:
Open-webui will now correctly format requests to the server, allowing for successful image generation without triggering exceptions.
Validated on:
Virtual environments (venv)
Bare systems with only python3 or python
Docker environments.
Confirmed that the correct interpreter and dependencies are used in all cases.
🔄 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/13327
**Author:** [@tuzkiyoung](https://github.com/tuzkiyoung)
**Created:** 4/29/2025
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `main`
---
### 📝 Commits (1)
- [`efa351e`](https://github.com/open-webui/open-webui/commit/efa351ea39eebc3377db6f87da3604c7311adb64) feat: compatible to gpt-image-1
### 📊 Changes
**1 file changed** (+5 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/routers/images.py` (+5 -1)
</details>
### 📄 Description
### Description:
This update fixes an incompatibility between open-webui and the gpt-image-1 image generation model. The gpt-image-1 model does not support the "response_format" parameter, which caused issues when generating images.
### Changes:
Replaced:
```python
"response_format": "b64_json",
```
with:
```python
"response_format": (
""
if "gpt-image-1" in request.app.state.config.IMAGE_GENERATION_MODEL
else "b64_json"
)
```
This ensures that an empty string is passed for the "response_format" parameter when using the gpt-image-1 model, and "b64_json" is used otherwise.
### Impact:
Open-webui will now correctly format requests to the server, allowing for successful image generation without triggering exceptions.
### Validated on:
* Virtual environments (venv)
* Bare systems with only python3 or python
* Docker environments.
Confirmed that the correct interpreter and dependencies are used in all cases.
---
<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/13327
Author: @tuzkiyoung
Created: 4/29/2025
Status: ❌ Closed
Base:
dev← Head:main📝 Commits (1)
efa351efeat: compatible to gpt-image-1📊 Changes
1 file changed (+5 additions, -1 deletions)
View changed files
📝
backend/open_webui/routers/images.py(+5 -1)📄 Description
Description:
This update fixes an incompatibility between open-webui and the gpt-image-1 image generation model. The gpt-image-1 model does not support the "response_format" parameter, which caused issues when generating images.
Changes:
Replaced:
with:
This ensures that an empty string is passed for the "response_format" parameter when using the gpt-image-1 model, and "b64_json" is used otherwise.
Impact:
Open-webui will now correctly format requests to the server, allowing for successful image generation without triggering exceptions.
Validated on:
Confirmed that the correct interpreter and dependencies are used in all cases.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.