mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
refac: images generation endpoint size field
This commit is contained in:
parent
7670543a39
commit
8eb5807c5f
1 changed files with 9 additions and 5 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue