diff --git a/backend/open_webui/routers/images.py b/backend/open_webui/routers/images.py index 5cd07e3d54..0c3d0993f5 100644 --- a/backend/open_webui/routers/images.py +++ b/backend/open_webui/routers/images.py @@ -483,11 +483,15 @@ async def image_generations( # if IMAGE_SIZE = 'auto', default WidthxHeight to the 512x512 default # This is only relevant when the user has set IMAGE_SIZE to 'auto' with an # image model other than gpt-image-1, which is warned about on settings save - width, height = ( - tuple(map(int, request.app.state.config.IMAGE_SIZE.split("x"))) - if "x" in request.app.state.config.IMAGE_SIZE - else (512, 512) - ) + + size = "512x512" + if "x" in request.app.state.config.IMAGE_SIZE: + size = request.app.state.config.IMAGE_SIZE + + if "x" in form_data.size: + size = form_data.size + + width, height = tuple(map(int, size.split("x"))) r = None try: