Simple Wildcards
The __name__ prompt randomizer, the old-school way
- text
Drop __country__ into a prompt, point this node at a folder with a country.txt full of names, and every run pulls a different one at random. That's the entire idea behind wildcards, and it's old - this exact __name__ syntax goes back to A1111 script days, old enough that plenty of people who started on ComfyUI after 2024 have never seen it, even though a lot of the character-variety and batch-generation tricks floating around StableDiffusion posts are built on it.
Simple Wildcards is GTSuya's original implementation of that idea, and per the pack's own README it's now the legacy option - kept around so old workflows don't break, with the author explicitly steering new builds toward Simple Wildcards (Dir.) instead, which does the same thing but lets you point at any folder rather than a fixed one. If you're starting fresh, that's the one to use; this one's for understanding what you're maintaining, or for the narrow case where ComfyUI's own root directory is genuinely where you want your wildcards to live.
How it works
This node hard-codes its lookup folder to a wildcards directory inside your ComfyUI root - you don't pass a path, you just create the folder and drop .txt files in it, one file per wildcard name. Write your prompt with __name__ tokens (double underscore on both sides, matching the filename minus .txt), and on each run the node picks a random line from the matching file and substitutes it in. Wildcards can nest - a line inside weather.txt can itself contain __temperature__, and it resolves recursively - lines starting with # are treated as comments and skipped, and empty lines are filtered out automatically so a blank line in your list doesn't occasionally return nothing.
Inputs and output
text- your prompt, multiline, with__wildcard__tokens wherever you want a random substitution.seed- reproducibility. Same seed, same picks, across runs - tie it to your global seed if you want a wildcard-resolved prompt to regenerate identically.wildcard_depth(default 50, range 2–256) - a recursion ceiling for nested wildcards, purely a safety net against an accidental A-references-B-references-A loop. You will basically never need to touch this.
Output is a single text (STRING) - the fully resolved prompt, ready for CLIP Text Encode.
Installing it
ComfyUI Manager: search ComfyUI-GTSuya-Nodes, install, restart. Or by hand: cd ComfyUI/custom_nodes && git clone https://github.com/GTSuya-Studio/ComfyUI-Gtsuya-Nodes.git, then restart. After that, create a wildcards folder in your ComfyUI root and start dropping in .txt files - no models, no extra dependencies.
Where people get burned
A wildcard referencing a file that doesn't exist doesn't error out - the literal __missing__ token stays in your output text and a warning prints to the console. That's genuinely useful for debugging, but only if you're watching the console; otherwise you'll wonder why your CLIP encoder is choking on double underscores. The other mix-up worth knowing about: if you've also got Impact Pack installed (most people do, it's near-universal), it ships its own __wildcard__ syntax with its own separate wildcards folder. Same double-underscore convention, completely different backend. If a wildcard you expect to resolve just passes through untouched, make sure you actually dropped the file into this node's wildcards folder and not Impact Pack's.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| seed | INT | 00–18446744073709550000 | — |
| wildcard_depth | INT | 502–256 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |