Nui.DynamicPromptsTextGen
Wildcard-style {a|b|c} syntax for your prompts
- STRING
If you've ever written a {red|blue|green} car in a prompt back on Automatic1111 and wondered why ComfyUI doesn't just understand that syntax natively - this is one of the nodes that brings it over. Dynamic Prompts Text Gen takes a prompt template with {option1|option2|option3} bracket groups, picks one option per run based on a seed, and hands you back the resolved string. It's the classic "wildcard" trick for getting prompt variety without hand-editing text between every generation.
One thing worth knowing up front, because the README's name for this node ("Dynamic Prompts Text Encode") oversells it a little: check the actual schema and this node only outputs a STRING, not CONDITIONING. It doesn't encode anything itself - it generates text, and you still need a normal CLIP Text Encode node downstream to turn that resolved string into something your sampler can use. Don't go looking for a way to plug this straight into a KSampler's positive/negative input; it won't connect, because the types don't match.
Where the syntax comes from
The {a|b|c} bracket format is old A1111-wildcard syntax, popularized originally by the sd-dynamic-prompts extension. It's genuinely useful for batch variety: write one templated prompt with a handful of bracket groups for hair color, weather, lighting, whatever, and every run (or every item in a batch) can land on a different concrete combination without you touching the text. It's also how a lot of people build quick character-reference sets - same subject, different camera/lighting/mood each pass, with zero training involved.
How it works
You write your prompt in the text field using that bracket syntax, and the node resolves it into one plain string. The seed is what actually decides which option gets picked each time - same idea as a KSampler seed, just applied to which branch of each {a|b|c} group wins rather than to noise. Bump the seed (or randomize it) to get a fresh combination; keep it fixed to reproduce the exact same expansion again.
That seed input also does double duty inside ComfyUI's caching model: ComfyUI skips re-running a node if none of its inputs changed since the last queue. Since this node's actual randomness lives in Python, not in the seed value itself, leaving the seed untouched across runs is exactly how you'd get the same cached string back - which is a feature if that's what you want, and a trap if you expected a new roll every time and forgot to change it.
The inputs and outputs that matter
text(required,STRING, multiline) - your templated prompt, bracket groups and all.seed(required,INT, default0, range0to roughly 1.8×10¹⁹) - drives which option each{a|b|c}group resolves to.
Output: a single STRING - the fully resolved prompt. Wire it into a standard CLIP Text Encode's text input to actually condition your sampler, or into this pack's own Output String node first if you want to eyeball what got picked before spending a run on it.
How to install it
It's one of three nodes in the small nui-suite pack.
- ComfyUI Manager - search nui suite, install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/space-nuko/nui-suite, then restart ComfyUI.
The README doesn't list any extra Python dependencies for the pack, so it looks like the bracket-syntax parsing is implemented inside the node itself rather than requiring the original sd-dynamic-prompts extension installed alongside it - you don't need to separately pip-install anything for this to work.
Common issues & troubleshooting
The curly braces show up literally in your output instead of getting resolved. Wildcard/dynamic-prompt style nodes across the ComfyUI ecosystem have a history of breaking this way after a ComfyUI update - text nodes on other packs have shipped this exact bug (unresolved {a|b|c} passed straight through as-is). If you hit it here, first confirm you're actually looking at this node's output and not a different text node upstream that happens to share similar syntax - the fix in those cases has generally been updating the specific pack, not ComfyUI itself.
Same output every run even though you're re-queuing. Check the seed actually changed between runs. Because ComfyUI caches node output by input hash, an unchanged seed on an unchanged text field is a legitimate reason to get the identical resolved string back - that's the caching working as designed, not the node being stuck.
Nested or weighted bracket syntax you remember from A1111 doesn't behave the way you expect. The schema here only exposes text and seed - there's no separate control for weighting or nested wildcard files, so keep your bracket groups simple (flat {a|b|c} choices) rather than assuming every feature from the original sd-dynamic-prompts extension carried over.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| seed | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |