Nodes/Dynamic Prompts/Dynamic Prompt
ComfyUI Node

Dynamic Prompt

Generate every prompt variation without queuing by hand

By exectails·Created 2 years ago·Updated 2 years ago· 7
Dynamic Prompt
    • text
    • seed
    • count
    text
    count1
    gen_typerandom
    seed_typerandom
    seed0

    If you've ever written a {red|blue|green} dog back in A1111 and watched it spit out a different color every run, you already know what this node does - it's that same trick, ported to ComfyUI, minus the manual queue-mashing. Dynamic Prompt (class ETDynamicPrompt, from the small exectails/comfyui-et_dynamicprompts pack) takes one text field with {option|option|option} groups in it and turns it into a batch of prompts - either a handful of random picks, or literally every possible combination in one shot. That bracket syntax isn't this node inventing something new: it's the old A1111 wildcard trick, and it's quietly still the fastest way to build a set of consistent-character or consistent-scene variations without training anything.

    Why you'd reach for it

    Say you're building a reference sheet: same subject, different hair colors and different weather. Instead of hand-editing the prompt and hitting queue nine times, you write a young woman with {brown|blonde|black} hair in the {rain|wind|snow} once and let the node produce all nine (or however many random draws you ask for). Under the hood it's using the dynamicprompts Python library - the same engine A1111's extension is built on - so the syntax and behavior will feel familiar if you've done this before.

    Random vs. combinatorial

    This is the one real decision the node makes you take. Random mode generates count prompts, each one a random pick from all the possible combinations - set count: 1 and you get one dice roll; set it higher and you get that many, with repeats possible. Combinatorial mode ignores count and just gives you everything: every color times every weather, full stop. That's the pack's whole pitch over the "semi-official" dynamic-prompts node - the README says it plainly: this one auto-generates all combinations without you manually queuing through them. It's also the one place to be careful. Bracket groups multiply fast - three groups of four options each is 64 prompts from one execution, and it's an easy number to blow past without meaning to if you nest a few groups. If you're not sure how big your combination space is, test in random mode first.

    Inputs and outputs that matter

    • text - your prompt, brackets and all. Multiline, so long compound prompts are fine.
    • count - how many prompts to generate in random mode (irrelevant in combinatorial mode, where every combination comes out regardless).
    • gen_type - random or combinatorial, per above.
    • seed_type - fixed gives every generated prompt the same seed (handy if you want the same subject with just prompt-level variation), sequential counts up from your seed one per prompt, and random derives a different seed per prompt from your base seed.
    • seed - the base seed that feeds seed_type.

    Outputs are text and seed, both marked as lists, plus a plain count telling you how many prompts actually came out. Wire text into a CLIP Text Encode and seed into your KSampler's seed input, and because they're lists ComfyUI fans the execution out automatically - one full run per generated prompt, no extra plumbing. That's the "no manual queuing" part working as advertised.

    Installing it

    Easiest path is ComfyUI Manager - search "Dynamic Prompts" and install. Doing it by hand: clone into custom_nodes and install its one dependency into ComfyUI's own Python environment, then restart.

    cd ComfyUI/custom_nodes
    git clone https://github.com/exectails/comfyui-et_dynamicprompts
    cd comfyui-et_dynamicprompts
    pip install -r requirements.txt
    

    No models to download - it's a pure text-processing node, so this is a lightweight install either way.

    Where people get tripped up

    The pip install step is the classic gotcha: if you're on a portable or embedded ComfyUI build, running plain pip install can hit your system Python instead of the one ComfyUI actually runs on, and the node will import-error on startup even though the install "succeeded." Use the embedded interpreter explicitly. The other trap is scope creep on combinatorial mode - nest a couple more bracket groups than you meant to and you can accidentally ask for a few thousand images in one queue; this is a real, recurring complaint in the wider dynamic-prompts community, not a hypothetical. And if what you actually want is __character__-style wildcard files rather than inline brackets, this isn't the node for it - that's explicitly the "semi-official" node's job, and this pack sticks to inline text on purpose.

    Categoryexectails/Dynamic

    Inputs (5)

    NameTypeDefaultDescription
    textSTRINGThe text to generate prompts from.
    countINT11–2000000000Number of prompts to generate for non-combinatorial prompts.
    gen_typeCOMBOrandomDetermines the type of prompt generation to use. Combinatorial returns all possible combinations, while random returns random combinations.
    seed_typeCOMBOrandomDetermines how returned seeds are generated. Fixed uses the set seed for all generations, sequential seeds start at the set seed, and random seeds are random for each prompt, seeded by the set seed.
    seedINT00–2000000000The seed to use for generating images. Plug returned seed(s) into sampler.

    Outputs (3)

    NameTypeDescription
    textSTRING
    seedINT
    countINT