ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Prompt randomizing feature stops working when prompt is passed as an input rather than in a widget

Open Shadetail opened this issue 1 year ago • 1 comments

image workflow.json

It seems that prompt randomizing feature used to work differently somehow. This trick used to work in order to preview which prompt combination actually got chosen: zdzoj5t7mecc1 (source)

But after I updated ComfyUI it no longer works, now the showtext node just shows the full prompt with all the curly brackets, implying that the random choosing now happens later at some point in the process, maybe in the "CLIP Text Encode (Prompt)" node?

Anyways, the implementation of this is very buggy now, the randomization works when using text input widget on "Clip Text Encode (Prompt)" node but then it doesn't when passing that same text along as the input, and then on top of that when input is disconnected and node is returned to widget state with text in the widget, then it continues not to work, it's like the node gets stuck in its bugged state, and the only way to get prompt randomization to work then is to use "Fix node (recreate)" or literally delete the node and place a new one in its place, which is probably the same thing that Fix node feature does.

This bug also broke the randomization when using "Text to Conditioning" WAS node as that's essentially Clip Text Encode with no text widget, so it now always acts like "Clip Text Encode (Prompt)" node in its bugged state.

Shadetail avatar Jun 03 '24 09:06 Shadetail

Still relevant on a freshly installed ComfyUI

CosmoMyzrailGorynych avatar Jul 01 '24 17:07 CosmoMyzrailGorynych

This issue is being marked stale because it has not had any activity for 30 days. Reply below within 7 days if your issue still isn't solved, and it will be left open. Otherwise, the issue will be closed automatically.

github-actions[bot] avatar Nov 05 '24 11:11 github-actions[bot]

This is related to the policy regarding whether text widgets support dynamicPrompt.

Originally, all text widgets were set to operate with dynamicPrompt as True by default, but due to too many side effects, it now operates with False as the default.

DynamicPrompt is explicitly enabled only in certain nodes like CLIPTextEncode. And Primitive nodes are excluded from this. It is recommended to use tools like ImpactWildcardProcessor from Impact Pack instead.

ltdrdata avatar Nov 07 '24 08:11 ltdrdata

Ah, ImpactWildcardProcessor is exactly the workaround I've been using ever since. I can now finally stop considering it a workaround. Thank you for explaining the reasoning behind this!

Shadetail avatar Nov 15 '24 19:11 Shadetail

Ah, ImpactWildcardProcessor is exactly the workaround I've been using ever since. I can now finally stop considering it a workaround. Thank you for explaining the reasoning behind this!

The reason why the dynamicPrompt feature of the textbox is disabled by default is precisely because of nodes like ImpactWildcardProcessor.

ImpactWildcardProcessor requires the original text to remain untouched so that it can process it during execution. Previously, random selections were made in advance, before the node was executed, making it uncontrollable.

Especially, it becomes impossible to control randomly selected items through values like seeds.

ltdrdata avatar Nov 16 '24 07:11 ltdrdata