dify's comfyui tool cant read file variable.
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 155
Description
### Custom Node Testing
- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)
### Expected Behavior
I use dify's comfyui tool to call a img2img workflow, I expect it works normally and return an edited image.
### Actual Behavior
tool report error, and I guess it is because comfyui tool cant read file variable, the reason why I assume is in "Steps to Reproduce":
>
> Run failed: Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"ConnectTimeout","message":"timed out"}
>
### 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": {
> "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": "{{#llm.text#}}",
> "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": ""
> },
> "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"
> }
> }
> }
### 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.
### Debug Logs
```powershell
Run failed: Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"ConnectTimeout","message":"timed out"}
```
### Other
_No response_
Contributor guide
Research direction
The report points to Dify's ComfyUI tool rather than a named ComfyUI source file or test. Start by reproducing the img2img workflow with sys.files and compare it with the working text2img workflow; determine whether the timeout originates in the integration or the ComfyUI API, then add a focused reproduction or test once the responsible component is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100