ComfyUI plugin: Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"UnboundLocalError","message":"cannot access local variable 'ws' where it is not associated with a value"} #305

Closed
opened 2026-02-16 10:18:54 -05:00 by yindo · 5 comments
Owner

Originally created by @Noobzm on GitHub (May 22, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.4

Plugin version

0.1.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

When I was using the Comfyui plugin to load the Comfyui workflow (official flux dev demo), I encountered this issue. I tried three versions: 0.07/0.09/0.11,please help me

✔️ Error log

No response

Originally created by @Noobzm on GitHub (May 22, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.4 ### Plugin version 0.1.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/0f65667e-ba41-47c3-b552-051b3c429f7d) When I was using the Comfyui plugin to load the Comfyui workflow (official flux dev demo), I encountered this issue. I tried three versions: 0.07/0.09/0.11,please help me ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:18:54 -05:00
yindo closed this issue 2026-02-16 10:18:55 -05:00
Author
Owner

@Noobzm commented on GitHub (May 22, 2025):

This is the workflow json:

{
"6": {
"inputs": {
"text": "cute anime girl with massive fluffy fennec ears and a big fluffy tail blonde messy long hair blue eyes wearing a maid outfit with a long black gold leaf pattern dress and a white apron mouth open placing a fancy black forest cake with candles on top of a dinner table of an old dark Victorian mansion lit by candlelight with a bright window to the foggy forest and very expensive stuff everywhere there are paintings on the walls",
"clip": [
"30",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"8": {
"inputs": {
"samples": [
"31",
0
],
"vae": [
"30",
2
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE解码"
}
},
"9": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "保存图像"
}
},
"27": {
"inputs": {
"width": 1024,
"height": 1024,
"batch_size": 1
},
"class_type": "EmptySD3LatentImage",
"_meta": {
"title": "空Latent图像(SD3)"
}
},
"30": {
"inputs": {
"ckpt_name": "flux1-dev-fp8.safetensors"
},
"class_type": "CheckpointLoaderSimple",
"_meta": {
"title": "Checkpoint加载器(简易)"
}
},
"31": {
"inputs": {
"seed": 948047819564729,
"steps": 20,
"cfg": 1,
"sampler_name": "euler",
"scheduler": "simple",
"denoise": 1,
"model": [
"30",
0
],
"positive": [
"35",
0
],
"negative": [
"33",
0
],
"latent_image": [
"27",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "K采样器"
}
},
"33": {
"inputs": {
"text": "",
"clip": [
"30",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"35": {
"inputs": {
"guidance": 3.5,
"conditioning": [
"6",
0
]
},
"class_type": "FluxGuidance",
"_meta": {
"title": "Flux引导"
}
}
}

@Noobzm commented on GitHub (May 22, 2025): This is the workflow json: { "6": { "inputs": { "text": "cute anime girl with massive fluffy fennec ears and a big fluffy tail blonde messy long hair blue eyes wearing a maid outfit with a long black gold leaf pattern dress and a white apron mouth open placing a fancy black forest cake with candles on top of a dinner table of an old dark Victorian mansion lit by candlelight with a bright window to the foggy forest and very expensive stuff everywhere there are paintings on the walls", "clip": [ "30", 1 ] }, "class_type": "CLIPTextEncode", "_meta": { "title": "CLIP Text Encode (Positive Prompt)" } }, "8": { "inputs": { "samples": [ "31", 0 ], "vae": [ "30", 2 ] }, "class_type": "VAEDecode", "_meta": { "title": "VAE解码" } }, "9": { "inputs": { "filename_prefix": "ComfyUI", "images": [ "8", 0 ] }, "class_type": "SaveImage", "_meta": { "title": "保存图像" } }, "27": { "inputs": { "width": 1024, "height": 1024, "batch_size": 1 }, "class_type": "EmptySD3LatentImage", "_meta": { "title": "空Latent图像(SD3)" } }, "30": { "inputs": { "ckpt_name": "flux1-dev-fp8.safetensors" }, "class_type": "CheckpointLoaderSimple", "_meta": { "title": "Checkpoint加载器(简易)" } }, "31": { "inputs": { "seed": 948047819564729, "steps": 20, "cfg": 1, "sampler_name": "euler", "scheduler": "simple", "denoise": 1, "model": [ "30", 0 ], "positive": [ "35", 0 ], "negative": [ "33", 0 ], "latent_image": [ "27", 0 ] }, "class_type": "KSampler", "_meta": { "title": "K采样器" } }, "33": { "inputs": { "text": "", "clip": [ "30", 1 ] }, "class_type": "CLIPTextEncode", "_meta": { "title": "CLIP Text Encode (Negative Prompt)" } }, "35": { "inputs": { "guidance": 3.5, "conditioning": [ "6", 0 ] }, "class_type": "FluxGuidance", "_meta": { "title": "Flux引导" } } }
Author
Owner

@yt-koike commented on GitHub (May 26, 2025):

Hello @Noobzm , I'm yt-koike and I've been working on updating ComfyUI plugin since 0.0.5.

Very strangely, the workflow worked normally without errors in my environment(Dify 1.4.0+ComfyUI 0.1.1).
It might be because of your network connection rather than plugins because the error you're encountering is very likely to show up when your Dify failed to connect to ComfyUI. I suspect the error occurs here.

Could you please share the DSL file of the workflow for further debugging if you don't mind? I also want to know your ComfyUI server's version. It might be because your ComfyUI server is old or not supported by this plugin. My ComfyUI server's version is 0.3.33, and the frontend's is 1.18.10 for your information.

@yt-koike commented on GitHub (May 26, 2025): Hello @Noobzm , I'm yt-koike and I've been working on updating ComfyUI plugin since 0.0.5. Very strangely, the workflow worked normally without errors in my environment(Dify 1.4.0+ComfyUI 0.1.1). It might be because of your network connection rather than plugins because the error you're encountering is very likely to show up when your Dify failed to connect to ComfyUI. I suspect the error occurs [here](https://github.com/langgenius/dify-official-plugins/blob/a1bdcac9324c1bd34da32ba214fdff37fd4a75bf/tools/comfyui/tools/comfyui_client.py#L288C2-L289C23). Could you please share the DSL file of the workflow for further debugging if you don't mind? I also want to know your ComfyUI **server**'s version. It might be because your ComfyUI server is old or not supported by this plugin. My ComfyUI server's version is 0.3.33, and the frontend's is 1.18.10 for your information.
Author
Owner

@yt-koike commented on GitHub (May 26, 2025):

Additionally, could you please try txt2img node, which is newer than workflow node? If it also cause errors, please share the error message here. Thank you :)

@yt-koike commented on GitHub (May 26, 2025): Additionally, could you please try txt2img node, which is newer than workflow node? If it also cause errors, please share the error message here. Thank you :)
Author
Owner

@Noobzm commented on GitHub (May 27, 2025):

@yt-koike
It was indeed a network problem. After some settings, the problem was solved (I'm not sure which operation worked)

but I encountered a new problem. It seems that the current workflow tool of comfyui plugin cannot support obtaining video output? I found that in tools such as img2vid, the output is actually webp format images instead of typical video formats such as mp4.

@Noobzm commented on GitHub (May 27, 2025): @yt-koike It was indeed a network problem. After some settings, the problem was solved (I'm not sure which operation worked) but I encountered a new problem. It seems that the current workflow tool of comfyui plugin cannot support obtaining video output? I found that in tools such as img2vid, the output is actually webp format images instead of typical video formats such as mp4.
Author
Owner

@yt-koike commented on GitHub (May 28, 2025):

@Noobzm Thank you for sharing your suggestion and I'm glad you fixed the network problem! Yes, it basically only supports image outputs, not videos but I'm planning to add that output feature sooner or later.

@yt-koike commented on GitHub (May 28, 2025): @Noobzm Thank you for sharing your suggestion and I'm glad you fixed the network problem! Yes, it basically only supports image outputs, not videos but I'm planning to add that output feature sooner or later.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#305