Skip to content

Comments

fix: pass background parameter to OpenAI Image Edit API#21459

Closed
sangyongsin wants to merge 2 commits intoopen-webui:devfrom
sangyongsin:fix/image-edit-background-parameter
Closed

fix: pass background parameter to OpenAI Image Edit API#21459
sangyongsin wants to merge 2 commits intoopen-webui:devfrom
sangyongsin:fix/image-edit-background-parameter

Conversation

@sangyongsin
Copy link

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.

Add background option to image edit request.
Added optional background parameter to edit_image function.
@pr-validator-bot
Copy link

🚫 STOP

@sangyongsin, you are trying to merge to the main branch!

This repository does not allow direct merges to the main branch! Please retarget your PR to the dev branch ASAP or your PR will be closed!


👋 Welcome and Thank You for Contributing!

We appreciate you taking the time to submit a pull request to Open WebUI!

⚠️ Important: Testing Requirements

We've recently seen an increase in PRs that have significant issues:

  • PRs that don't actually fix the bug they claim to fix
  • PRs that don't implement the feature they describe
  • PRs that break existing functionality
  • PRs that are clearly AI-generated without proper testing being done by the author
  • PRs that simply don't work as intended

These untested PRs consume significant time from maintainers and volunteer contributors who review and test PRs in their free time.
Time that could be spent testing other PRs or improving Open WebUI in other ways.

Before marking your PR as "Ready for Review":

Please explicitly confirm:

  1. ✅ You have personally tested ALL changes in this PR
  2. How you tested it (specific steps you took to verify it works)
  3. Visual evidence where applicable (screenshots or videos showing the feature/fix working) - if applicable to your specific PR

If you're not certain your PR works exactly as intended, please leave it in DRAFT mode until you've thoroughly tested it.

Thank you for helping us maintain quality and respecting the time of our community! 🙏

@sangyongsin sangyongsin changed the base branch from main to dev February 16, 2026 08:07
@tjbck
Copy link
Contributor

tjbck commented Feb 16, 2026

Should be addressed in dev, as for the built-in tools it may not be prudent to add one if it's not universally supported. Open to discussions here!

@tjbck tjbck closed this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants