fix: pass background parameter to OpenAI Image Edit API#21459
fix: pass background parameter to OpenAI Image Edit API#21459sangyongsin wants to merge 2 commits intoopen-webui:devfrom
Conversation
Add background option to image edit request.
Added optional background parameter to edit_image function.
🚫 STOP@sangyongsin, you are trying to merge to the This repository does not allow direct merges to the 👋 Welcome and Thank You for Contributing!We appreciate you taking the time to submit a pull request to Open WebUI!
|
|
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! |
Pull Request Checklist
devfix:Changelog Entry
Description
The OpenAI Image Edit API (
gpt-image-1) supports abackgroundparameter with values"transparent","opaque", or"auto", but Open WebUI does not pass this parameter through. This means users cannotcontrol background transparency when editing images via the built-in tool.
Added
backgroundfield toEditImageFormmodel ("transparent","opaque", or"auto")backgroundparameter toedit_imagebuilt-in tool function with docstringChanged
Deprecated
Removed
Fixed
backgroundparameter is now passed to the OpenAI Image Edit API when providedSecurity
Breaking Changes
Additional Information
**({"background": form_data.background} if form_data.background else {})same as other optional parameters likesize,nNone, so no breaking change to existing behaviorScreenshots or Videos
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.