mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
[Bug] ComfyUI Plugin v0.0.8 Breaking Change: UnboundLocalError on Missing Top-Level Prompt Parameter #272
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 @toddkingsing on GitHub (May 10, 2025).
Self Checks
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
@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
UnboundLocalErroryou're encountering in ComfyUI Plugin v0.0.8 is due to the requirement for a top-levelpromptparameter. In v0.0.8, thepromptparameter is retrieved from thetool_parametersdictionary, 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
promptparameter. This is a change from v0.0.7, where thepromptparameter was not required if you were using{{positive_prompt}}. Adding this parameter should prevent theUnboundLocalErrorand 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
@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.