Nodes/Kinburg-Nodes/Prompt Variations
ComfyUI Node

Prompt Variations

Sweep Every Prompt Combination Without Copy-Pasting the Canvas

By Kinburg·Created 3 months ago·Updated 6 days ago· 1
Prompt Variations
    • prompts
    • count
    • preview
    template{a photo|a painting} of a {red|blue|green} car
    modeall
    limit25
    seed0
    dedupetrue
    wildcards_dir

    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 - all produces every combination, capped by limit (extras past the cap are dropped with a console note). random picks limit random 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>.txt files live. Empty uses ComfyUI/wildcards if 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.

    CategoryKinburg-Nodes/prompt

    Inputs (6)

    NameTypeDefaultDescription
    templateSTRING{a photo|a painting} of a {red|blue|green} carTemplate with {a|b|c} choices (nesting allowed) and optional __wildcard__ refs. The output is the product of all choices.
    modeCOMBOallall = every combination (capped by limit); random = 'limit' random combinations (reproducible via seed).
    limitINT251–5000Max prompts to output. In 'all' mode extra combinations past this are dropped (a console note is printed).
    seedINT00–18446744073709550000Randomness seed for 'random' mode (same seed = same picks).
    dedupeBOOLEANtrueDrop duplicate resulting prompts (e.g. from overlapping choices).
    wildcards_diroptSTRINGFolder with <name>.txt files for __name__ refs. Empty = ComfyUI/wildcards if it exists. A missing file leaves the token unchanged.

    Outputs (3)

    NameTypeDescription
    promptsSTRING
    countINT
    previewSTRING