Nodes/ComfyUI Text Processor/Wildcards Processor
ComfyUI Node

Wildcards Processor

One wildcard node with seven slots — the prompt mixer that scales

By rookiestar28·Created 10 months ago·Updated 10 days ago· 16
Wildcards Processor
    • STRING
    seed0
    prompt_1
    wildcard_1
    prompt_2
    wildcard_2
    prompt_3
    wildcard_3
    prompt_4
    wildcard_4
    prompt_5
    wildcard_5
    prompt_6
    wildcard_6
    prompt_7
    wildcard_7

    Wildcards are the simplest way to make prompts non-repetitive: you write __style__ in your prompt, the node swaps in a random line from style.txt, and every run is a little different. Wildcards Processor is that concept turned into a seven-slot mixer - seven independent prompt segments, each of which can hold manual text, inline {a|b} choices, a wildcard file, or any combination.

    If you've ever wanted "same pose, random outfit" or a batch of prompts where one segment varies and the rest stay fixed, this is a one-node answer instead of a tangled string of prompt-merge nodes. It's also deterministic - feed it a seed and it's reproducible, which matters more than you'd think when a random prompt accidentally produces something great and you want it back.

    How it works

    Each of the 7 slots pairs a multiline text box (prompt_1prompt_7) with a dropdown (wildcard_1wildcard_7). In the box you can write plain text and inline random choices: {cat|dog|fox} picks one at random. In the dropdown you pick a wildcard file - a .txt where each line is an option - or Random, which picks a random file from your collection for that slot. Both box and dropdown can be active at once; they get concatenated into that slot's segment, and the final output joins the non-empty segments with spaces.

    Two details make it behave well. First, recursive expansion: a wildcard file can itself contain __other_wildcard__ references and they resolve too. Second, each slot runs on a seeded offset from the base seed - so even if two slots contain the identical {A|B} syntax, they won't stubbornly produce the same pick. That's the kind of thing that sounds minor until you've watched a "varied" prompt output identical images ten times.

    Wildcard files are found in ComfyUI/wildcards/ first, then the plugin's own wildcards/ folder - same convention the rest of the ComfyUI wildcard ecosystem uses.

    Inputs and outputs

    Honestly: seed and whatever subset of the seven prompt boxes you need. The dropdowns are optional per slot. Output is one STRING - the fully expanded combined prompt - which feeds straight into a CLIP Text Encode.

    Install

    It lives in ComfyUI Text Processor, so install the pack once:

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

    Or ComfyUI Manager → search "ComfyUI Text Processor" → Install → restart. Then put some wildcard files in ComfyUI/wildcards/ (or the pack's wildcards/ folder, where an example_format sample ships).

    Gotchas

    The dropdown list is read at node-load time - add a new wildcard file and you'll want to refresh before it shows up. And remember each slot's independent seed offset: if you want two slots to vary in sync rather than independently, this node actively fights you, which is usually the right call but worth knowing. For single-variable wildcard needs, a simpler one-slot node may be less ceremony - this one earns its keep when you're building layered, semi-random prompts.

    CategoryComfyUI Text Processor

    Inputs (15)

    NameTypeDefaultDescription
    seedINT00–18446744073709550000Base seed for deterministic inline choices and wildcard selection.
    prompt_1STRINGFirst prompt segment; supports {a|b} and __wildcard__ syntax.
    wildcard_1COMBOOptional wildcard file appended to the first prompt segment.
    prompt_2STRINGSecond prompt segment; supports {a|b} and __wildcard__ syntax.
    wildcard_2COMBOOptional wildcard file appended to the second prompt segment.
    prompt_3STRINGThird prompt segment; supports {a|b} and __wildcard__ syntax.
    wildcard_3COMBOOptional wildcard file appended to the third prompt segment.
    prompt_4STRINGFourth prompt segment; supports {a|b} and __wildcard__ syntax.
    wildcard_4COMBOOptional wildcard file appended to the fourth prompt segment.
    prompt_5STRINGFifth prompt segment; supports {a|b} and __wildcard__ syntax.
    wildcard_5COMBOOptional wildcard file appended to the fifth prompt segment.
    prompt_6STRINGSixth prompt segment; supports {a|b} and __wildcard__ syntax.
    wildcard_6COMBOOptional wildcard file appended to the sixth prompt segment.
    prompt_7STRINGSeventh prompt segment; supports {a|b} and __wildcard__ syntax.
    wildcard_7COMBOOptional wildcard file appended to the seventh prompt segment.

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGCombined prompt text after wildcard and random-choice expansion.