[PR #21459] [CLOSED] fix: pass background parameter to OpenAI Image Edit API #41720

Closed
opened 2026-04-25 13:53:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/21459
Author: @sangyongsin
Created: 2/16/2026
Status: Closed

Base: devHead: fix/image-edit-background-parameter


📝 Commits (2)

  • b266434 fix/image-edit-background-parameter
  • b4d0336 fix/image-edit-background-parameter

📊 Changes

2 files changed (+5 additions, -1 deletions)

View changed files

📝 backend/open_webui/routers/images.py (+2 -0)
📝 backend/open_webui/tools/builtin.py (+3 -1)

📄 Description

Pull Request Checklist

  • Target branch: dev
  • Description: Provided below.
  • Changelog: Provided below.
  • Documentation: No user-facing behavior changes requiring docs update.
  • Dependencies: No new dependencies.
  • Testing: Manually tested with gpt-image-1 model using transparent/opaque/auto background options.
  • Agentic AI Code: This PR has been manually reviewed and tested by a human.
  • Code review: Self-reviewed.
  • Design & Architecture: Minimal change, follows existing pattern for optional API parameters.
  • Git Hygiene: Single atomic commit.
  • Title Prefix: fix:

Changelog Entry

Description

The OpenAI Image Edit API (gpt-image-1) supports a background parameter with values "transparent", "opaque", or "auto", but Open WebUI does not pass this parameter through. This means users cannot
control background transparency when editing images via the built-in tool.

Added

  • background field to EditImageForm model ("transparent", "opaque", or "auto")
  • background parameter to edit_image built-in tool function with docstring

Changed

  • N/A

Deprecated

  • N/A

Removed

  • N/A

Fixed

  • background parameter is now passed to the OpenAI Image Edit API when provided

Security

  • N/A

Breaking Changes

  • N/A

Additional Information

  • Follows existing pattern: **({"background": form_data.background} if form_data.background else {}) same as other optional parameters like size, n
  • Parameter is optional with default None, so no breaking change to existing behavior
  • Reference: OpenAI Image Edit API docs

Screenshots or Videos

  • N/A (API parameter passthrough, no UI change)

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/21459 **Author:** [@sangyongsin](https://github.com/sangyongsin) **Created:** 2/16/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/image-edit-background-parameter` --- ### 📝 Commits (2) - [`b266434`](https://github.com/open-webui/open-webui/commit/b26643423331dcbbe188ef18e417a10b529c9788) fix/image-edit-background-parameter - [`b4d0336`](https://github.com/open-webui/open-webui/commit/b4d0336f5aec4988441a563960f12e7228435d91) fix/image-edit-background-parameter ### 📊 Changes **2 files changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/routers/images.py` (+2 -0) 📝 `backend/open_webui/tools/builtin.py` (+3 -1) </details> ### 📄 Description # Pull Request Checklist - [x] **Target branch:** `dev` - [x] **Description:** Provided below. - [x] **Changelog:** Provided below. - [ ] **Documentation:** No user-facing behavior changes requiring docs update. - [ ] **Dependencies:** No new dependencies. - [x] **Testing:** Manually tested with gpt-image-1 model using transparent/opaque/auto background options. - [x] **Agentic AI Code:** This PR has been manually reviewed and tested by a human. - [x] **Code review:** Self-reviewed. - [x] **Design & Architecture:** Minimal change, follows existing pattern for optional API parameters. - [x] **Git Hygiene:** Single atomic commit. - [x] **Title Prefix:** `fix:` # Changelog Entry ### Description The OpenAI Image Edit API (`gpt-image-1`) supports a `background` parameter with values `"transparent"`, `"opaque"`, or `"auto"`, but Open WebUI does not pass this parameter through. This means users cannot control background transparency when editing images via the built-in tool. ### Added - `background` field to `EditImageForm` model (`"transparent"`, `"opaque"`, or `"auto"`) - `background` parameter to `edit_image` built-in tool function with docstring ### Changed - N/A ### Deprecated - N/A ### Removed - N/A ### Fixed - `background` parameter is now passed to the OpenAI Image Edit API when provided ### Security - N/A ### Breaking Changes - N/A --- ### Additional Information - Follows existing pattern: `**({"background": form_data.background} if form_data.background else {})` same as other optional parameters like `size`, `n` - Parameter is optional with default `None`, so no breaking change to existing behavior - Reference: [OpenAI Image Edit API docs](https://platform.openai.com/docs/api-reference/images/createEdit) ### Screenshots or Videos - N/A (API parameter passthrough, no UI change) ### 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>
GiteaMirror added the pull-request label 2026-04-25 13:53:17 -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#41720