瀏覽代碼

Merge pull request #11515 from davizucon/main

fix: url value when response contains url tag
Timothy Jaeryang Baek 2 月之前
父節點
當前提交
6399aaf4b2
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      backend/open_webui/routers/images.py

+ 2 - 4
backend/open_webui/routers/images.py

@@ -517,10 +517,8 @@ async def image_generations(
             images = []
 
             for image in res["data"]:
-                if "url" in image:
-                    image_data, content_type = load_url_image_data(
-                        image["url"], headers
-                    )
+                if image_url := image.get("url", None):
+                    image_data, content_type = load_url_image_data(image_url, headers)
                 else:
                     image_data, content_type = load_b64_image_data(image["b64_json"])