From 708e56666a85bcf5a083eeae4c533caad699b4a1 Mon Sep 17 00:00:00 2001 From: hp0912 <809211365@qq.com> Date: Wed, 6 May 2026 21:07:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E7=94=9F=E5=9B=BE=E3=80=81?= =?UTF-8?q?=E5=9B=BE=E7=94=9F=E5=9B=BE=E5=8F=91=E9=80=81=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 15 ++++++++++++++- README.md | 2 +- skills/image-to-image/scripts/image_to_image.py | 4 ++-- skills/text-to-image/scripts/text_to_image.py | 4 ++-- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 0ec81e0..c1ff940 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,9 +5,22 @@ "name": "text-to-image", "type": "debugpy", "request": "launch", - "program": "skills/text-to-image/scripts/debug_openai_image_generation_test.py", + "program": "skills/text-to-image/scripts/text_to_image.py", "console": "integratedTerminal", "justMyCode": true, + "args": [ + "--prompt=马云在直播间卖红薯", + "--model=gpt-image-2" + ], + "env": { + "ROBOT_WECHAT_CLIENT_PORT": "9001", + "ROBOT_FROM_WX_ID": "57004904192@chatroom", + "ROBOT_CODE": "houhouipad", + "MYSQL_HOST": "127.0.0.1", + "MYSQL_PORT": "3306", + "MYSQL_USER": "root", + "MYSQL_PASSWORD": "houhou" + } } ] } \ No newline at end of file diff --git a/README.md b/README.md index 5f6fe45..734655e 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ { "to_wxid": "{{ROBOT_FROM_WX_ID}}", - "file_path": ["{{file_path}}"] + "file_path": "{{file_path}}" } ``` diff --git a/skills/image-to-image/scripts/image_to_image.py b/skills/image-to-image/scripts/image_to_image.py index a9f536d..188314c 100644 --- a/skills/image-to-image/scripts/image_to_image.py +++ b/skills/image-to-image/scripts/image_to_image.py @@ -350,11 +350,11 @@ def _send_image_outputs(client_port: str, from_wx_id: str, image_outputs: list[s response = _http_post_json(send_url, send_body, {"Content-Type": "application/json"}, timeout=300) _debug_response("send image url response", response) - if local_paths: + for file_path in local_paths: send_url = f"http://127.0.0.1:{client_port}/api/v1/robot/message/send/image/local" send_body = { "to_wxid": from_wx_id, - "file_path": local_paths, + "file_path": file_path, } response = _http_post_json(send_url, send_body, {"Content-Type": "application/json"}, timeout=300) _debug_response("send image local response", response) diff --git a/skills/text-to-image/scripts/text_to_image.py b/skills/text-to-image/scripts/text_to_image.py index 2691b0e..0291fdc 100644 --- a/skills/text-to-image/scripts/text_to_image.py +++ b/skills/text-to-image/scripts/text_to_image.py @@ -361,11 +361,11 @@ def _send_image_outputs(client_port: str, from_wx_id: str, image_outputs: list[s response = _http_post_json(send_url, send_body, {"Content-Type": "application/json"}, timeout=300) _debug_response("send image url response", response) - if local_paths: + for file_path in local_paths: send_url = f"http://127.0.0.1:{client_port}/api/v1/robot/message/send/image/local" send_body = { "to_wxid": from_wx_id, - "file_path": local_paths, + "file_path": file_path, } response = _http_post_json(send_url, send_body, {"Content-Type": "application/json"}, timeout=300) _debug_response("send image local response", response)