File tree Expand file tree Collapse file tree
backend/open_webui/routers Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments