CLIPTextEncodeWithWildcards
Wildcards that are actually tied to your seed
- clip
- CONDITIONING
- INT
The name undersells it. Sure, this is a CLIP text encoder - feed it a CLIP model and text, get conditioning out, same as the stock CLIPTextEncode. But the reason you'd reach for it is the __eyecolor__ syntax. You type placeholders into your prompt, and the node swaps each one for a random line from a text file before encoding. It's a prompt randomizer hiding inside an encoder, and it's the faithful ComfyUI port of the wildcards feature A1111 users had built in for years.
If you came from Automatic1111 you already know the workflow: keep a folder of .txt files, one option per line (hazel, green, brown…), write __eyecolor__ in the prompt, batch a render, and every image differs. This node recreates that in ComfyUI, where the alternative is either Impact Pack's wildcard processor or the full dynamicprompts pack - both of which drag in a lot of machinery you may not want. This is the standalone one, and it's exactly the kind of node people recommend in r/comfyui when someone asks for randomization "without installing a 100-node pack."
How it works
The node reads from a wildcards folder at the root of your ComfyUI install (ComfyUI/wildcards), not inside the custom node. Files are one option per line. When you encode, it scans the text for __anything__, looks up anything.txt, and replaces it with line number seed % (line count). That single line of math is the whole design, and it's the interesting part: your wildcard picks are a deterministic function of the seed. Same seed plus the same text gives the same choices, every time. So you can batch 32 renders, watch the eyes and hair shuffle, and still reproduce any single image by just rerunning its seed.
The mechanism is otherwise a straight CLIP encode - tokenize, encode, spit out standard conditioning with a pooled output, exactly what a KSampler expects.
The inputs and outputs that matter
- text - your prompt, with
__placeholder__markers. Multiline, so structure away. - clip - the CLIP model, from any checkpoint loader.
- seed - an INT, default 0, up to 2^64−1. This drives the wildcard picks.
Outputs are the two that count: CONDITIONING, which wires into KSampler like any encoder, and an INT that just echoes the seed you put in. The README's trick is to reroute that INT into KSampler's seed input. Then one seed controls both the wildcard choices and the sampling - rerun it, and you get the same face with the same hair, not just the same face.
Installing it
Grab it via ComfyUI Manager by searching "comfyui_wildcards" (or "ComfyUI-Wildcards"), or clone it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/lordgasmic/comfyui_wildcards
Then restart ComfyUI. That's the whole install - there are no requirements, no model downloads, nothing heavy. The bit people actually trip on is the next step in the README: create the wildcards directory at your ComfyUI root and drop your .txt files there. Put them inside custom_nodes/comfyui_wildcards and the node will never see them, and it won't tell you - it just prints "WILDCARD NOT FOUND" and substitutes that literal string into your prompt.
Where people get burned
The WILDCARD NOT FOUND case above is the top one: it means the filename inside the underscores doesn't match a .txt in the wildcards folder, or the folder isn't where the node expects it. Second: the matching regex only allows letters, numbers, and hyphens. __eye_color__ will not match - no underscores or spaces inside the placeholder. Use __eye-color__ or just eyecolor. And because the pick is seed % line_count, a short file repeats quickly; a five-line file shows the same option every fifth seed, so pad small files or accept the repetition.
One honest caveat the author flags in the README: unlike A1111, the chosen value isn't baked into the PNG info. The workflow metadata saves __eyecolor__, not hazel. Re-running with the same seed reproduces the pick fine, but you can't read the actual choice back out of the saved image - so hang onto the seed if you ever need to know which hair you got. For your negative prompt, just use a plain CLIPTextEncode; randomizing negatives is almost never what you want.
It's not fancy, but it's small, seed-driven, and does exactly one thing well. For pumping out character variants - different eyes, clothes, expressions across a batch - it's the one I'd reach for.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| clip | CLIP | — | |
| seed | INT | 00–18446744073709550000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |
| INT | INT | — |