Prompt Variations
Sweep Every Prompt Combination Without Copy-Pasting the Canvas
- prompts
- count
- preview
The classic way to test prompt ideas is to copy a workflow, change one word, run, and repeat until your canvas is a graveyard of near-identical tabs. Prompt Variations is the input generator that breaks that habit: one template, many prompts, emitted as a list you feed straight into a loop. It's the A/B test engine for prompts, and it's been a missing piece of core ComfyUI for a long time.
The template syntax
Write choices with {a|b|c} - nesting allowed, so {a {x|y}|b} expands fully - and the node emits the cartesian product. Empty options like {, dramatic|} mean "nothing" (dangling commas get cleaned up), which is how you make a variant optional. There's also wildcard support: __name__ refs pull one option per line from <wildcards_dir>/name.txt (default ComfyUI/wildcards), which is old A1111 syntax that most people who arrived after 2024 never learned - and it's exactly as useful here as it was there.
An example: a {cinematic|flat} portrait of {a knight|a robot}, {Rembrandt|rim} lighting produces every combination - cinematic portrait of a knight with Rembrandt lighting, flat portrait of a robot with rim lighting, and so on.
The controls
mode-allproduces every combination, capped bylimit(extras past the cap are dropped with a console note).randompickslimitrandom combinations.seed- only matters in random mode; same seed, same picks.dedupe- drops duplicate resulting prompts, which happens more than you'd think when overlapping choices produce the same string.wildcards_dir(optional) - where<name>.txtfiles live. Empty usesComfyUI/wildcardsif it exists; a missing file leaves the token unchanged.
Outputs: prompts (a per-item STRING list), count, and a preview so you can eyeball the expansion before committing.
The workflow it unlocks
The pack's docs give the shape: Prompt Variations → For Each (Open) → your sampler → a Set/Get Accumulator → Image Compare, to render and compare every variant at once. That's the whole pitch - render the sweep in one run instead of twenty. The preview output is worth using before you fire the loop: a 4×4×4 template is 64 combinations, and checking the expansion first is how you avoid rendering 64 near-identical images. It pairs naturally with the pack's Prompt Presets node too - keep the stable vocabulary in presets, put the variation in the template.
Install
Part of the Kinburg-Nodes pack - ComfyUI Manager (search "Kinburg-Nodes"), or cd ComfyUI/custom_nodes && git clone https://github.com/Kinburg/Kinburg-Nodes, restart. No dependencies. It's a pure text-expansion node, so there's nothing to download. If you've been copy-pasting workflows to test prompts, this is the node that makes you wonder why you didn't find it sooner.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| template | STRING | {a photo|a painting} of a {red|blue|green} car | Template with {a|b|c} choices (nesting allowed) and optional __wildcard__ refs. The output is the product of all choices. |
| mode | COMBO | all | all = every combination (capped by limit); random = 'limit' random combinations (reproducible via seed). |
| limit | INT | 251–5000 | Max prompts to output. In 'all' mode extra combinations past this are dropped (a console note is printed). |
| seed | INT | 00–18446744073709550000 | Randomness seed for 'random' mode (same seed = same picks). |
| dedupe | BOOLEAN | true | Drop duplicate resulting prompts (e.g. from overlapping choices). |
| wildcards_diropt | STRING | Folder with <name>.txt files for __name__ refs. Empty = ComfyUI/wildcards if it exists. A missing file leaves the token unchanged. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| prompts | STRING | — |
| count | INT | — |
| preview | STRING | — |