Nodes/ComfyUI-JNodes/Parse Dynamic Prompts
ComfyUI Node

Parse Dynamic Prompts

{a|b|c} prompt variety with anti-repeat controls

By JaredTherriault·Created 3 years ago·Updated about a month ago· 91
Parse Dynamic Prompts
    • STRING
    text
    mode
    seed0
    use_same_seed_for_all_groupsfalse
    enforce_different_outputsfalse
    anti_repeat_strength0.75

    Dynamic prompts are the {red|green|blue} trick: you write a prompt with bracketed options, and each run the parser picks one from each group. It's how people generate variety without editing the prompt by hand every time - a batch of 32 that walks through combinations of subject, lighting, and setting. The syntax is old A1111 wildcard heritage that a lot of people who arrived after 2024 never learned, but it's still one of the cleanest ways to explore a space of prompts.

    JNodes_ParseDynamicPrompts is Jared Therriault's take on it - the readme literally calls it "yet another dynamic prompts implementation," which is refreshingly honest. What sets it apart is the randomization controls, specifically the anti-repeat machinery aimed at stopping a batch from picking the same combination twice.

    How it works

    You give it text containing {option|option} groups. Per run it resolves each group down to one choice and emits the finished prompt as a STRING. How it chooses depends on the mode and the anti-repeat settings - the interesting part is that it can actively push consecutive outputs to differ, rather than rolling the dice independently each time and occasionally handing you three identical results in a row.

    The inputs and outputs

    • text (multiline STRING) - your prompt with {a|b|c} groups.
    • mode (seed / index) - seed drives the pick from the seed value (random-feeling); index walks through deterministically.
    • seed (INT) - the randomization source in seed mode.
    • enforce_different_outputs (default false) - the anti-dupe switch. Turn it on to make the node try to avoid repeating a previous result.
    • anti_repeat_strength (default 0.75, range 0–1) - how hard it pushes for difference when enforce_different_outputs is on.
    • use_same_seed_for_all_groups (default false) - whether every group shares one seed or each gets its own.
    • STRING output - the resolved prompt, ready for a CLIP text-encode.

    How to install it

    Via ComfyUI Manager: Install Custom Nodes, search "JNodes", install, restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JaredTherriault/ComfyUI-JNodes
    pip install -r ComfyUI-JNodes/requirements.txt
    

    then restart ComfyUI. No model downloads.

    Common issues & troubleshooting

    It clashes with ComfyUI's built-in dynamic prompts - disable that one. This is the big one, and it's called out in the JNodes readme: if Comfy.DynamicPrompts (the native web extension) is enabled, the included JNodes solution can't operate. Open ComfyUI Settings → JNodes → Extension Management and uncheck Comfy.DynamicPrompts, then refresh the page. Running two dynamic-prompt systems over the same text is a recipe for one of them silently winning.

    anti_repeat_strength does nothing unless enforce_different_outputs is on. The strength slider only matters when you've actually enabled the anti-repeat behavior. If your batch is still throwing duplicates, check that the switch is on first, then raise the strength toward 1.

    Nested or malformed brackets bite. Dynamic-prompt syntax is picky about matching braces. An unclosed { or a stray | can produce output you didn't expect. If a group isn't resolving, eyeball the brackets before blaming the node.

    index mode is deterministic - that's the point. If you want reproducible walks through combinations (for an XY-style sweep), use index. If you want variety that feels random, use seed and change the seed each run. Picking the wrong mode is the usual reason people get "too repetitive" or "not reproducible" complaints.

    Categorydynamic prompts

    Inputs (6)

    NameTypeDefaultDescription
    textSTRING
    modeCOMBOSeed bases the output on a random seed. Index directly gets the choice at the given index.
    seedINT0
    use_same_seed_for_all_groupsBOOLEANfalseIf false, enforce different deterministic seeds per group.
    enforce_different_outputsBOOLEANfalseIf true, ensures multiple groups with similar options won't output the same value.
    anti_repeat_strengthFLOAT0.750–1Controls how strongly the node avoids repeating options from the previous run. 0 = repeats not reduced, 1 = virtually no repeats. Intermediate values reduce the chance of repeats proportionally.

    Outputs (1)

    NameTypeDescription
    STRINGSTRING