Skip to content

use static seed for wildcard-nodes if text is not seed dependent#1190

Open
vslinx wants to merge 2 commits into
ltdrdata:Mainfrom
vslinx:Main
Open

use static seed for wildcard-nodes if text is not seed dependent#1190
vslinx wants to merge 2 commits into
ltdrdata:Mainfrom
vslinx:Main

Conversation

@vslinx

@vslinx vslinx commented Feb 4, 2026

Copy link
Copy Markdown

Why this change?

I use the wildcard nodes in several dynamic workflows, often inside subgraphs, where I pass multiline prompts directly into the populated_text input. In practice, I frequently tweak settings later in the graph and re-run the workflow. Right now, that often forces a full re-execution from the wildcard node onward because the node’s seed changes—even when the prompt contains no wildcard/dynamic syntax and the output would be identical.

Manually fixing the seed in every subgraph isn’t very practical, and adding additional seed controls outside the subgraphs just to stabilize this one node would add clutter. This change avoids unnecessary re-runs by normalizing the seed when it cannot affect the processed text, while keeping existing behavior intact for prompts that actually use seed-dependent syntax.

Technical changes

When ImpactWildcardProcessor or ImpactWildcardEncode is used with the seed control set to randomize / increment / decrement, ComfyUI updates the seed value on every run. Even if the prompt contains no wildcard or dynamic syntax, the changed seed ends up in the queued prompt JSON, which forces downstream nodes to re-execute.

This change detects when the effective input text contains no seed-dependent Impact syntax and, in that case, normalizes the seed to a fixed value (0) before execution. This prevents unnecessary prompt “population” work and avoids re-running the workflow when the actual prompt content has not changed.

When the input text is provided via a link, the handler walks upstream through the linked nodes and inspects their text inputs to determine whether any Impact wildcard/dynamic syntax (i.e. seed-dependent content) could be present. Only when it can confidently determine that no seed-dependent syntax exists anywhere upstream does it normalize the seed to 0 internally, preventing unnecessary downstream re-execution. This approach also works when text is routed through subgraphs or composed via concat/other string nodes. The normalization is only applied when the seed itself is a direct integer input (not a linked value), so externally controlled seeds are never overridden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant