From 7b4a9fb7c9209c7bbb09f6c1e03ef6c30e6521fa Mon Sep 17 00:00:00 2001 From: imeepos Date: Thu, 31 Jul 2025 14:21:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DComfyUI=20JSON?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=B8=ADimage=E5=AD=97=E6=AE=B5=E7=9A=84?= =?UTF-8?q?=E5=80=BC=E7=B1=BB=E5=9E=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题修复: - image字段的值从字符串字面量改为Value::String类型 - 确保image和image_url字段二选一的逻辑正确 技术细节: - 模特图片替换: image字段设置为空字符串,使用image_url - 商品图片替换: image字段设置为空字符串,使用image_url - 修复了Value类型不匹配的编译错误 影响范围: - ComfyUI工作流JSON替换逻辑 - 调试文件生成的正确性 - 图片节点参数的正确传递 --- .../src-tauri/src/business/services/comfyui_service.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src-tauri/src/business/services/comfyui_service.rs b/apps/desktop/src-tauri/src/business/services/comfyui_service.rs index bfd5d7b..5c1cd12 100644 --- a/apps/desktop/src-tauri/src/business/services/comfyui_service.rs +++ b/apps/desktop/src-tauri/src/business/services/comfyui_service.rs @@ -339,11 +339,11 @@ impl ComfyUIService { value: Value::String(cdn_url), }); - // 替换image字段为文件名 + // 替换image字段为空字符串(使用image_url) replacements.push(WorkflowNodeReplacement { node_id: node_id.clone(), input_field: "image".to_string(), - value: Value::String(filename), + value: Value::String("".to_string()), }); } "product" => { @@ -358,11 +358,11 @@ impl ComfyUIService { value: Value::String(cdn_url), }); - // 替换image字段为文件名 + // 替换image字段为空字符串(使用image_url) replacements.push(WorkflowNodeReplacement { node_id: node_id.clone(), input_field: "image".to_string(), - value: Value::String(filename), + value: Value::String("".to_string()), }); } "prompt" => {