Nodes/ComfyUI_EmAySee_CustomNodes/EmAySee Dynamic List Processor
ComfyUI Node

EmAySee Dynamic List Processor

Inline wildcard syntax with a seed — dynamic prompts that you can actually reproduce

By EmAySee·Created about a year ago·Updated 4 months ago· 2
EmAySee Dynamic List Processor
    • processed_text
    text{a|b|c{s1|s2}|d}
    seed0

    You know the trick - write {blonde|brunette|redhead} in a prompt and each run picks a different option. It's old A1111 wildcard syntax, it's how people batch prompt variety without writing thirty prompts by hand, and ComfyUI mostly doesn't ship it built-in. This node is that trick, inline in a text box, with a seed so the same batch isn't just chaos. Drop in {a|b|c{s1|s2}|d} and get a randomly-expanded string out the other end - nested groups included.

    How it works

    It's a small recursive parser. It scans your text for {...} groups, splits each group on | (respecting nested braces, so c{s1|s2} stays one option until it's recursed into), and picks one option per group. Crucially, the picker is seeded: random.Random(seed) drives all choices, so the same input text plus the same seed always expands the same way. That's the difference between this and the raw bracket trick - reproducibility. Batch 32 prompts, get 32 combinations; fix the seed, get that exact combination back any time you want it.

    The inputs

    • text (STRING, multiline) - your template with {option|option|option} groups. The default {a|b|c{s1|s2}|d} is a working example: c is a group whose expansion contains a nested group, so it picks between s1 and s2 as well.
    • seed (INT, 0–2^64) - the RNG seed.

    Output: processed_text, a single STRING with every group collapsed to one chosen option. Wire it straight into a CLIP Text Encode positive prompt.

    Why not the usual wildcard node?

    Impact Pack's wildcards use a different model: files on disk, __name__ syntax, a curated library of options. That's great when you want shared wildcard files. This node is the opposite end of the spectrum - the options live right in the prompt box, you can see them while you edit, and the seeded expansion means your "random" batch is reproducible instead of a one-way trip. It also supports nesting, which file-based wildcards usually handle awkwardly. For quick inline variation it's arguably the friendlier tool; for a big reusable library, the file approach still wins.

    Install

    Part of ComfyUI_EmAySee_CustomNodes. ComfyUI Manager → search "EmAySee" → install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/EmAySee/ComfyUI_EmAySee_CustomNodes
    

    No requirements.txt, no models. Restart after install and you'll see the pack's "SPECTRE v5.0" banner in the console.

    Gotchas

    Unbalanced braces - a { with no matching } - fall through to plain text rather than erroring, so a typo silently disables a group. And the parser is not a full dynamic-prompt engine: no __file__ includes, no probability weights like {a|b}::2. Keep it to inline option lists. Also remember the node only re-expands when it re-runs; bump the seed to roll again.

    CategoryEmAySee/Text

    Inputs (2)

    NameTypeDefaultDescription
    textSTRING{a|b|c{s1|s2}|d}
    seedINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    processed_textSTRING