mirror of
https://github.com/open-webui/open-webui.git
synced 2025-03-17 21:32:42 +01:00
refac: images "url" fallback
This commit is contained in:
parent
46cea1f904
commit
9c107f9d2d
@ -517,7 +517,13 @@ async def image_generations(
|
||||
images = []
|
||||
|
||||
for image in res["data"]:
|
||||
image_data, content_type = load_b64_image_data(image["b64_json"])
|
||||
if "url" in image:
|
||||
image_data, content_type = load_url_image_data(
|
||||
image["url"], headers
|
||||
)
|
||||
else:
|
||||
image_data, content_type = load_b64_image_data(image["b64_json"])
|
||||
|
||||
url = upload_image(request, data, image_data, content_type, user)
|
||||
images.append({"url": url})
|
||||
return images
|
||||
|
Loading…
x
Reference in New Issue
Block a user