[PR #13327] [CLOSED] feat: support gpt-image-1 #78028

Closed
opened 2026-05-13 11:38:07 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/13327
Author: @tuzkiyoung
Created: 4/29/2025
Status: Closed

Base: devHead: main


📝 Commits (1)

  • efa351e feat: 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:

"response_format": "b64_json",

with:

"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.

🔄 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>
GiteaMirror added the pull-request label 2026-05-13 11:38:07 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#78028