Skip to content

Commit f6bd54f

Browse files
committed
refac
1 parent d9fd2a3 commit f6bd54f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

backend/open_webui/routers/images.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,10 @@ async def image_generations(
641641

642642
for image in res["data"]:
643643
if image_url := image.get("url", None):
644-
image_data, content_type = get_image_data(image_url, headers)
644+
image_data, content_type = get_image_data(
645+
image_url,
646+
{k: v for k, v in headers.items() if k != "Content-Type"},
647+
)
645648
else:
646649
image_data, content_type = get_image_data(image["b64_json"])
647650

@@ -993,7 +996,10 @@ def get_image_file_item(base64_string, param_name="image"):
993996
images = []
994997
for image in res["data"]:
995998
if image_url := image.get("url", None):
996-
image_data, content_type = get_image_data(image_url, headers)
999+
image_data, content_type = get_image_data(
1000+
image_url,
1001+
{k: v for k, v in headers.items() if k != "Content-Type"},
1002+
)
9971003
else:
9981004
image_data, content_type = get_image_data(image["b64_json"])
9991005

0 commit comments

Comments
 (0)