mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
dify's comfyui tool cant read file variable, timeout #650
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @matrix12315 on GitHub (Sep 16, 2025).
Self Checks
Dify version
1.6.0
Plugin version
0.2.5
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Steps to Reproduce
I have used text2img workflow, it works, so the comfyui configuration is right.
1. use img2img "workflow" node of comfyui tool
2. input comfyui's img2img json api
3. select sys.files variable and basic settings
4. run work flow and fail beacuse the sys.files has values
Run failed: Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"ConnectTimeout","message":"timed out"}
5. run work flow and success after reset sys.files, but it doest meet my requirements of edit image in this situation.
✔️ Error log
Run failed: Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"ConnectTimeout","message":"timed out"}
@dosubot[bot] commented on GitHub (Sep 16, 2025):
The most common reason ComfyUI workflows in Dify can't read the
sys.filesvariable is thatsys.filesis an Array[File], not a single File. You need to add a "list filter" node in your workflow to process the array before passing it to ComfyUI—otherwise, the workflow can't handle the file input correctly [source].Timeout errors like
PluginInvokeError: ConnectTimeoutare usually caused by Docker network or environment misconfiguration. Make sure yourFILES_URLis set to an externally accessible address (likehttp://host.docker.internal) in your.envfile, and restart your containers after updating. Also, check that your ComfyUI service address is correct and both services can reach each other [source] [source].If your workflow still fails, try increasing the timeout settings in your
docker-compose.yaml(CODE_EXECUTION_CONNECT_TIMEOUT,CODE_EXECUTION_READ_TIMEOUT,CODE_EXECUTION_WRITE_TIMEOUT,WORKFLOW_MAX_EXECUTION_TIME) to allow more time for image processing [source].Also, make sure your images are in supported formats (JPG, JPEG, PNG, GIF, WEBP, SVG), and that you are not trying to parse files in a Code node, which is not supported [source].
If possible, upgrade to the latest ComfyUI plugin (0.2.6+)—recent updates improved connection handling and error reporting, which may help with file variable issues [source].
Let me know if you need more details on any of these steps!
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@matrix12315 commented on GitHub (Sep 16, 2025):
my yml file
comfyuiBUG.yml
@matrix12315 commented on GitHub (Sep 16, 2025):
@dosu I need a human engineer please, all the solution you provided doesnt work
@dosubot[bot] commented on GitHub (Sep 16, 2025):
I understand this is frustrating. As an AI, I can't provide direct human engineering support, but I can help you troubleshoot further.
Based on recent plugin updates and code analysis, your issue is likely caused by either a malformed workflow JSON (missing required 'nodes' or 'links' arrays), improper file variable mapping, or a network/configuration problem between Dify and ComfyUI. The ComfyUI plugin expects the workflow JSON to have a top-level
nodesarray and usually alinksarray—if either is missing or malformed, you'll get errors or timeouts. Make sure you export your workflow from ComfyUI using the "Save(API Format)" option with Dev Mode enabled, and do not edit the JSON before uploading it to Dify. Regular exports may not include the required structure, which can break the plugin [source].Timeout errors like
PluginInvokeError: ConnectTimeoutare often caused by Docker network misconfiguration or an inaccessible FILES_URL. Double-check that your.envfile setsFILES_URLto an externally accessible address (likehttp://host.docker.internal) and that both Dify and ComfyUI containers can reach each other. Restart your containers after making changes [source].If you are still on plugin version 0.2.5, upgrade to 0.2.6—recent fixes directly address connection handling, workflow parsing, and file variable mapping issues that could cause exactly this kind of failure [source].
If none of these steps resolve the problem, please share the raw content of your comfyuiBUG.yml (copy-paste the YAML/JSON here) so I can inspect it for missing structure or mapping errors. If you have any additional error logs or details about your Docker/network setup, that would also help pinpoint the issue.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@matrix12315 commented on GitHub (Sep 16, 2025):
@dosu
app:
description: ''
icon: 🤖
icon_background: '#FFEAD5'
mode: advanced-chat
name: comfyuiBUG
use_icon_as_answer_icon: false
dependencies:
type: marketplace
value:
marketplace_plugin_unique_identifier: langgenius/comfyui:0.2.5@f0964db9c1927196b74a487ce119b8d7dba85ca040ffc46e3e848e81283618a2
kind: app
version: 0.3.0
workflow:
conversation_variables: []
environment_variables: []
features:
file_upload:
allowed_file_extensions:
- .JPG
- .JPEG
- .PNG
- .GIF
- .WEBP
- .SVG
allowed_file_types:
- image
allowed_file_upload_methods:
- remote_url
- local_file
enabled: true
number_limits: 3
opening_statement: ''
retriever_resource:
enabled: true
sensitive_word_avoidance:
enabled: false
speech_to_text:
enabled: false
suggested_questions: []
suggested_questions_after_answer:
enabled: false
text_to_speech:
enabled: false
language: ''
voice: ''
graph:
edges:
isInIteration: false
isInLoop: false
sourceType: start
targetType: tool
id: 1757993451564-source-1757993493409-target
source: '1757993451564'
sourceHandle: source
target: '1757993493409'
targetHandle: target
type: custom
zIndex: 0
isInLoop: false
sourceType: tool
targetType: answer
id: 1757993493409-source-answer-target
source: '1757993493409'
sourceHandle: source
target: answer
targetHandle: target
type: custom
zIndex: 0
nodes:
desc: ''
selected: false
title: Start
type: start
variables:
allowed_file_types:
allowed_file_upload_methods:
label: edit
max_length: 5
options: []
required: false
type: file
variable: edit
height: 90
id: '1757993451564'
position:
x: 12.680492111556532
y: 296
positionAbsolute:
x: 12.680492111556532
y: 296
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
answer: '{{#1757993493409.files#}}'
desc: ''
selected: false
title: Answer
type: answer
variables: []
height: 104
id: answer
position:
x: 680
y: 282
positionAbsolute:
x: 680
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
desc: ''
is_team_authorization: true
output_schema: null
paramSchemas:
default: null
form: llm
human_description:
en_US: exported from ComfyUI workflow
ja_JP: ComfyUI よりエクスポートされたワークフロー
pt_BR: exported from ComfyUI workflow
zh_Hans: 从ComfyUI的工作流中导出
label:
en_US: Workflow JSON
ja_JP: ワークフロー JSON
pt_BR: Workflow JSON
zh_Hans: Workflow JSON
llm_description: ''
max: null
min: null
name: workflow_json
options: []
placeholder: null
precision: null
required: true
scope: null
template: null
type: string
default: null
form: llm
human_description:
en_US: The input images
ja_JP: 入力画像
pt_BR: The input images
zh_Hans: 输入的图片
label:
en_US: Input Images
ja_JP: Input Images
pt_BR: Input Images
zh_Hans: 输入的图片
llm_description: The input images, used to transfer to the comfyui workflow
to generate another image.
max: null
min: null
name: images
options: []
placeholder: null
precision: null
required: false
scope: null
template: null
type: files
default: null
form: llm
human_description:
en_US: When the workflow has multiple image nodes, enter the ID list of
these nodes, and the images will be passed to ComfyUI in the order of
the list.
ja_JP: When the workflow has multiple image nodes, enter the ID list of
these nodes, and the images will be passed to ComfyUI in the order of
the list.
pt_BR: When the workflow has multiple image nodes, enter the ID list of
these nodes, and the images will be passed to ComfyUI in the order of
the list.
zh_Hans: 当工作流有多个图片节点时,输入这些节点的ID列表,图片将按列表顺序传给ComfyUI
label:
en_US: Image Node ID List
ja_JP: Image Node ID List
pt_BR: Image Node ID List
zh_Hans: 图片节点ID列表
llm_description: ''
max: null
min: null
name: image_ids
options: []
placeholder: null
precision: null
required: false
scope: null
template: null
type: string
default: 1
form: form
human_description:
en_US: If enabled, all the seeds in the workflow will be randomized.
ja_JP: If enabled, all the seeds in the workflow will be randomized.
pt_BR: If enabled, all the seeds in the workflow will be randomized.
zh_Hans: If enabled, all the seeds in the workflow will be randomized.
label:
en_US: Randomize seeds
ja_JP: Randomize seeds
pt_BR: Randomize seeds
zh_Hans: Randomize seeds
llm_description: ''
max: null
min: null
name: randomize_seed
options: []
placeholder: null
precision: null
required: false
scope: null
template: null
type: boolean
default: 1
form: form
human_description:
en_US: If enabled, all the models in the workflow will be downloaded.
ja_JP: If enabled, all the models in the workflow will be downloaded.
pt_BR: If enabled, all the models in the workflow will be downloaded.
zh_Hans: If enabled, all the models in the workflow will be downloaded.
label:
en_US: Download models
ja_JP: Download models
pt_BR: Download models
zh_Hans: Download models
llm_description: ''
max: null
min: null
name: enable_download
options: []
placeholder: null
precision: null
required: false
scope: null
template: null
type: boolean
params:
enable_download: ''
image_ids: ''
images: ''
randomize_seed: ''
workflow_json: ''
provider_id: langgenius/comfyui/comfyui
provider_name: langgenius/comfyui/comfyui
provider_type: builtin
selected: false
title: Workflow
tool_configurations:
enable_download:
type: constant
value: false
randomize_seed:
type: constant
value: false
tool_description: Run ComfyUI workflow.
tool_label: Workflow
tool_name: workflow
tool_parameters:
image_ids:
type: mixed
value: null
images:
type: variable
value:
'1757993451564'
edit
workflow_json:
type: mixed
value: '{
"3": {
"inputs": {
"seed": 601685180812477,
"steps": 20,
"cfg": 2.5,
"sampler_name": "euler",
"scheduler": "simple",
"denoise": 1,
"model": [
"75",
0
],
"positive": [
"76",
0
],
"negative": [
"77",
0
],
"latent_image": [
"88",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "KSampler"
}
},
"8": {
"inputs": {
"samples": [
"3",
0
],
"vae": [
"39",
0
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"37": {
"inputs": {
"unet_name": "qwen_image_edit_fp8_e4m3fn.safetensors",
"weight_dtype": "default"
},
"class_type": "UNETLoader",
"_meta": {
"title": "Load Diffusion Model"
}
},
"38": {
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"type": "qwen_image",
"device": "default"
},
"class_type": "CLIPLoader",
"_meta": {
"title": "Load CLIP"
}
},
"39": {
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"class_type": "VAELoader",
"_meta": {
"title": "Load VAE"
}
},
"60": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "Save Image"
}
},
"66": {
"inputs": {
"shift": 3,
"model": [
"37",
0
]
},
"class_type": "ModelSamplingAuraFlow",
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"75": {
"inputs": {
"strength": 1,
"model": [
"66",
0
]
},
"class_type": "CFGNorm",
"_meta": {
"title": "CFGNorm"
}
},
"76": {
"inputs": {
"prompt": "对输入图像中的遮瑕盘产品进行精准颜色替换:识别遮瑕盘内所有4个(2*2排列)独立遮瑕膏单元,并将这些单元的颜色严格按从左到右顺序依次替换为以下十六进制颜色代码:#3070bc(单元1)、#4fafec(单元2)、#ffff54(单元3)、#f6c443(单元4)。仅修改遮瑕膏膏体区域(排除外壳、文字、阴影等),确保颜色替换后边界自然、无色差,且保持原始图像分辨率与光照效果。",
"clip": [
"38",
0
],
"vae": [
"39",
0
],
"image": [
"93",
0
]
},
"class_type": "TextEncodeQwenImageEdit",
"_meta": {
"title": "TextEncodeQwenImageEdit"
}
},
"77": {
"inputs": {
"prompt": "",
"clip": [
"38",
0
],
"vae": [
"39",
0
],
"image": [
"93",
0
]
},
"class_type": "TextEncodeQwenImageEdit",
"_meta": {
"title": "TextEncodeQwenImageEdit"
}
},
"78": {
"inputs": {
"image": "sample.jpg"
},
"class_type": "LoadImage",
"_meta": {
"title": "Load Image"
}
},
"88": {
"inputs": {
"pixels": [
"93",
0
],
"vae": [
"39",
0
]
},
"class_type": "VAEEncode",
"_meta": {
"title": "VAE Encode"
}
},
"93": {
"inputs": {
"upscale_method": "lanczos",
"megapixels": 1,
"image": [
"78",
0
]
},
"class_type": "ImageScaleToTotalPixels",
"_meta": {
"title": "Scale Image to Total Pixels"
}
}
}'
type: tool
version: '2'
height: 148
id: '1757993493409'
position:
x: 376.01543462829227
y: 271.5830333611526
positionAbsolute:
x: 376.01543462829227
y: 271.5830333611526
selected: true
sourcePosition: right
targetPosition: left
type: custom
width: 244
viewport:
x: 172.33833978368705
y: 16.554326232165607
zoom: 0.57434919693741
@dosubot[bot] commented on GitHub (Sep 16, 2025):
Your workflow fails because the JSON format you’re using (numbered keys, e.g.
"78": {...}) is not fully compatible with ComfyUI plugin v0.2.5 in Dify. This plugin version expects the workflow JSON to usenodesandlinksarrays (the "API format" export from ComfyUI with Dev Mode enabled). When the format doesn’t match, file variables like your uploaded image aren’t mapped to theLoadImagenode, so the plugin times out or fails to process the file input [details].Also, if the
LoadImagenode’simageinput is hardcoded (e.g."image": "sample.jpg"), the plugin may not overwrite it with your uploaded file, causing a mismatch [details].How to fix:
nodesandlinksarrays, which the plugin can parse and map files to correctly [instructions].LoadImagenodes. The plugin will automatically map your uploaded file(s) to these nodes in order..envforFILES_URLand ensure both Dify and ComfyUI containers can reach each other. Restart containers after changes [network tips].If you can’t upgrade, you’ll need to manually restructure your workflow JSON to use the
nodes/linksformat, or try a minimal workflow with only oneLoadImagenode and no hardcoded image name.Let me know if you want an example of the correct JSON format or more details on any step.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
