From 6ae2d2c4eae0c6e67612a8226ea5f92ed019791f Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 29 Apr 2025 19:34:00 +0400 Subject: [PATCH] refac: gpt-image-1 support --- backend/open_webui/routers/images.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/routers/images.py b/backend/open_webui/routers/images.py index 275704f34..22fd8ac71 100644 --- a/backend/open_webui/routers/images.py +++ b/backend/open_webui/routers/images.py @@ -500,7 +500,11 @@ async def image_generations( if form_data.size else request.app.state.config.IMAGE_SIZE ), - "response_format": "b64_json", + **( + {"response_format": "b64_json"} + if "gpt-image-1" in request.app.state.config.IMAGE_GENERATION_MODEL + else {} + ), } # Use asyncio.to_thread for the requests.post call