Nodes/Arctenoxs-Essentials_ComfyUI/Wildcard String (Arctenox's Essentials)
ComfyUI Node

Wildcard String (Arctenox's Essentials)

A text box that resolves wildcards, for anywhere plain text goes

By Arctenox·Created 8 months ago·Updated 2 months ago· 1
Wildcard String (Arctenox's Essentials)
    • text
    • resolved_text
    text
    wildcard_seed0

    Most wildcard nodes in this pack are aimed at prompts specifically. Wildcard String is the odd one out in the best way: it's a general-purpose multiline string primitive that resolves wildcards on the way out. Use it anywhere you need a text value that changes per run - a filename prefix, a metadata field, a notes string, or a prompt segment you want to keep out of the main encode path.

    Type your text, which can contain both wildcard forms:

    • {a|b|c} - picks one option at random.
    • __filename__ - picks a random line from wildcards/filename.txt.

    Two inputs total: text (multiline) and wildcard_seed. The seed is the interesting one - -1 gives you new random picks every run, while 0+ locks the resolution to that seed. That second mode is why this node earns its place: a locked seed means a wildcard string is reproducible, which matters when a run comes out perfect and you want to regenerate the exact same output. Set the same wildcard_seed on the string and your sampler, and the whole pipeline replays.

    Outputs are text (the original, unchanged) and resolved_text (wildcards resolved). Keeping both is a small deliberate move - you can log the template while encoding the concrete string.

    Mechanically it's the same resolver the rest of the pack uses, with one nuance worth knowing: the node's IS_CHANGED hook returns a non-hashable sentinel when the seed is -1, which tells ComfyUI to re-execute it every run even if the graph hasn't changed. That's what makes -1 actually give you a different pick each time instead of caching the old one. If you ever set -1 and feel like you're getting repeats, it's worth checking that the node is actually re-running in your workflow.

    Where you'd reach for this versus the Wildcard Processor: the Processor takes any string from any source and resolves it; Wildcard String is where the string originates. Use it when you want the wildcard text to be editable in the graph rather than buried inside a CLIP encode's text field, or when the resolved value needs to feed something that isn't a CLIP encode at all - a batch filename with a {v2|v3|final} pick, say.

    Install. Part of Arctenox's Essentials - ComfyUI Manager → search "Arctenox's Essentials", or:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/Arctenox/Arctenoxs-Essentials_ComfyUI
    

    Restart ComfyUI. Wildcard files are read from the pack's wildcards/ folder or ComfyUI/wildcards/. No extra dependencies beyond torch and numpy (optional psutil). The README marks the pack deprecated as the author remasters it, but wildcard syntax is standard A1111-era stuff, so this skill transfers anywhere.

    CategoryArctenox Essentials/Prompting

    Inputs (2)

    NameTypeDefaultDescription
    textSTRINGAny text. Wildcards are resolved on output: {a|b|c} → picks one option at random __filename__ → picks a random line from wildcards/filename.txt
    wildcard_seedINT0-1–18446744073709550000Seed for wildcard resolution. -1 = new random picks every run 0+ = locked / reproducible

    Outputs (2)

    NameTypeDescription
    textSTRING
    resolved_textSTRING