Преглед изворни кода

refac: gpt-image-1 support

Timothy Jaeryang Baek пре 11 месеци
родитељ
комит
6ae2d2c4ea
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      backend/open_webui/routers/images.py

+ 5 - 1
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