[Bug] ComfyUI Plugin v0.0.8 Breaking Change: UnboundLocalError on Missing Top-Level Prompt Parameter #272

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

Originally created by @toddkingsing on GitHub (May 10, 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 search for existing issues, 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

latest

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

After upgrading the ComfyUI plugin from v0.0.7 to v0.0.8 via Dify Plugin Marketplace, I encountered a breaking change that causes all previously working workflows to fail with the following error:

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

Observations
v0.0.7 runs perfectly without requiring a top-level prompt parameter.
v0.0.8 requires a top-level prompt parameter, even if the workflow JSON already uses {{positive_prompt}}.

The error message suggests modifying the workflow JSON, but that alone does not resolve the issue—a top-level prompt is still required.

Downgrading back to v0.0.7 immediately resolves the issue without any workflow changes.

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @toddkingsing on GitHub (May 10, 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 [search for existing issues](https://github.com/langgenius/dify/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 latest ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce After upgrading the ComfyUI plugin from v0.0.7 to v0.0.8 via Dify Plugin Marketplace, I encountered a breaking change that causes all previously working workflows to fail with the following error: Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"UnboundLocalError","message":"cannot access local variable 'prompt' where it is not associated with a value"} Observations v0.0.7 runs perfectly without requiring a top-level prompt parameter. v0.0.8 requires a top-level prompt parameter, even if the workflow JSON already uses {{positive_prompt}}. The error message suggests modifying the workflow JSON, but that alone does not resolve the issue—a top-level prompt is still required. Downgrading back to v0.0.7 immediately resolves the issue without any workflow changes. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-16 10:18:45 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 10, 2025):

Hello @toddkingsing! I'm Dosu, your friendly bot here to help you with bugs, answer questions, and guide you as a contributor. I'm here while you wait for a human maintainer. How can I assist you today?

The UnboundLocalError you're encountering in ComfyUI Plugin v0.0.8 is due to the requirement for a top-level prompt parameter. In v0.0.8, the prompt parameter is retrieved from the tool_parameters dictionary, and if it's not provided, the method returns an error message asking for a prompt input [1].

To resolve this issue, ensure that your workflow JSON includes a top-level prompt parameter. This is a change from v0.0.7, where the prompt parameter was not required if you were using {{positive_prompt}}. Adding this parameter should prevent the UnboundLocalError and allow your workflows to function correctly in v0.0.8.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (May 10, 2025): <!-- Greeting --> Hello @toddkingsing! I'm [Dosu](https://dosu.dev), your friendly bot here to help you with bugs, answer questions, and guide you as a contributor. I'm here while you wait for a human maintainer. How can I assist you today? <!-- Answer --> The `UnboundLocalError` you're encountering in ComfyUI Plugin v0.0.8 is due to the requirement for a top-level `prompt` parameter. In v0.0.8, the `prompt` parameter is retrieved from the `tool_parameters` dictionary, and if it's not provided, the method returns an error message asking for a prompt input <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/tools/provider/builtin/comfyui/tools/comfyui_stable_diffusion.py)</sup>. To resolve this issue, ensure that your workflow JSON includes a top-level `prompt` parameter. This is a change from v0.0.7, where the `prompt` parameter was not required if you were using `{{positive_prompt}}`. Adding this parameter should prevent the `UnboundLocalError` and allow your workflows to function correctly in v0.0.8. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/8db6f314-1b08-45ef-b717-cf2fa0b6ded1?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/8db6f314-1b08-45ef-b717-cf2fa0b6ded1?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/8db6f314-1b08-45ef-b717-cf2fa0b6ded1?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/8db6f314-1b08-45ef-b717-cf2fa0b6ded1?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8db6f314-1b08-45ef-b717-cf2fa0b6ded1?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/8db6f314-1b08-45ef-b717-cf2fa0b6ded1?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8db6f314-1b08-45ef-b717-cf2fa0b6ded1?feedback_type=other)</sup>
Author
Owner

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

Hello, @toddkingsing. I'm sorry that my changes on ComfyUI 0.0.8 caused some gliches. I noticed those bugs happening after the merge. I tried to fix them as soon as possible and released a new PR to fix them up.
The reason why I missed this bug is that I didn't set up FILES_URL in .env file correctly.
I would be more careful when I make PRs next time.

@yt-koike commented on GitHub (May 11, 2025): Hello, @toddkingsing. I'm sorry that my changes on ComfyUI 0.0.8 caused some gliches. I noticed those bugs happening after the merge. I tried to fix them as soon as possible and released a [new PR](https://github.com/langgenius/dify-official-plugins/pull/892) to fix them up. The reason why I missed this bug is that I didn't set up FILES_URL in .env file correctly. I would be more careful when I make PRs next time.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#272