Nodes/ComfyUI-stable-wildcards/Stable Wildcard Output
ComfyUI Node

Stable Wildcard Output

The node that actually tells you what it picked

By DigitalIO·Created 3 years ago·Updated 11 months ago· 35
Stable Wildcard Output
    • Prompt String
    prompt
    seed0
    version1

    Here's the dirty secret of ComfyUI's built-in wildcard syntax: when you write {seductive|alluring|tempting} duck in a multiline prompt box and ComfyUI expands it, the PNG metadata saves all the options, not the one actually used. A couple of updates back that's exactly what ComfyUI started doing, and it quietly murdered prompt iteration - you couldn't tell whether the vintage car in your image came from "vintage" or "retro", so you couldn't figure out which one to tune. Stable Wildcards exists to fix that one thing, and it's good at it.

    What it is

    Stable Wildcards is a prompt-string node from the tiny ComfyUI-stable-wildcards pack by Michael Wolfe (DigitalIO). It replaces the plain text input that feeds a CLIP Text Encode node. You type a wildcard prompt, hand it a seed, and it spits out the final, fully-expanded string. No API calls, no model files, no extra Python dependencies - it's a regex and a random number generator in a trench coat.

    The syntax is the same old A1111 bracket trick most people arriving after 2024 never learned:

    A painting of a {boat|fish} in the {sea|lake}
    

    Each {a|b|c} group picks one option at random. Everything between the brackets gets replaced - so include spaces ({cat|dog} fish) or drop them on purpose to build compounds ({cat|dog}fishcatfish). No nested brackets; the pattern only matches innermost groups.

    How it works

    The mechanism is the whole point. It compiles a regex for {[^{}]+}, splits the contents on |, and picks using a fresh random.Random(seed) object. Because that RNG is seeded, the same prompt plus the same seed always produces the same expansion - that's the "stable" in the name, and it's why this one is different from the ecosystem's random-every-run wildcard packs.

    Two details make it feel like someone actually thought about this:

    • The prompt widget is created with dynamicPrompts: False, so ComfyUI's own randomizer never gets a chance to mangle your text before the node sees it.
    • On execution it stashes the chosen prompt inside the workflow metadata (a stable-wildcards namespace keyed by node id), which is what gets embedded in the PNG. Reload the workflow from the image later and the node's front-end shows the exact prompt that ran as the textarea's title - no more guessing.

    The author made a deliberate call to keep wildcard expansion separate from the CLIP node (other packs fuse the two), and to never support external wildcard files - files live outside the workflow, so they can't be guaranteed reproducible. Annoying if you're coming from .txt-based wildcard packs; the right call if you care about what this node is actually for.

    The inputs that matter

    • prompt - your wildcard text, multiline. Default empty; the one you'll always set.
    • seed - an INT from 0 to sys.maxsize. This is your reproducibility dial: keep prompt and seed identical and you get the same expansion every time.
    • version - an enum that's currently just [1], reserved for future backward-compatibility changes. You won't touch it.

    The single output, Prompt String, wires straight into a CLIP Text Encode node's text input.

    Installing it

    ComfyUI Manager (search "ComfyUI-stable-wildcards"), or the old-fashioned way:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DigitalIO/ComfyUI-stable-wildcards
    

    Then restart ComfyUI. No pip install, no model downloads, no heavy deps - the whole pack is two Python files and a small JS extension.

    Where people get burned

    It's a stable, low-maintenance node, but a few things bite. One user reported it "stopped working completely" after a ComfyUI update in 2025. That tracks: the pack's own JavaScript has a block commented out because a UI proxy it used broke core ComfyUI behavior in later versions. If it stops expanding after you update, pull the latest version via Manager, restart, and check the browser console.

    Also keep your expectations in line with the design. It won't read wildcard files, won't nest, and the seed does double duty - change the seed to sample a different combination, change only the prompt and it will too. If you just want churn in every run, ComfyUI's built-in braces are free and fine. If you need to know exactly what generated that image, and reproduce it a week later from the PNG alone, this is the one you reach for.

    CategoryStableWildcards

    Inputs (3)

    NameTypeDefaultDescription
    promptSTRING
    seedINT00–9223372036854776000
    versionCOMBO11 options: 1

    Outputs (1)

    NameTypeDescription
    Prompt StringSTRING