Wildcard Prompt Builder π§©
Inline {this|that} prompt variety without a single file
- prompt
Not every prompt needs a wildcard file. Sometimes you just want to write a {red|blue|green} {car|bicycle}, {sunny|rainy} day and have ComfyUI pick one option per slot on each run. That's exactly what Wildcard Prompt Builder does - the inline-{}-only companion to the pack's Wildcard Loader, with zero files involved. The whole option set lives right in the node.
This is the tool behind the community's favorite prompt-variety trick: build a template with {brown|blonde|black} hair and {raining|windy|snowing} weather, batch it, and get the same subject across different cameras, lighting and moods without training anything. The KB's prompt-engineering doc calls this the bracket trick - old A1111 syntax that most people who arrived after 2024 never learned. This node is the modern way to run it.
How it works
It's a regex resolver with a seeded random picker. Each {a|b|c} group gets one option chosen via random.Random(seed), groups can nest ({a|{b|c}}), and nested groups resolve innermost-first until none remain. There's a guard loop so pathological templates can't spin forever, and at the end it collapses extra whitespace. Same seed, same output - that's the reproducibility contract, same as its file-based sibling.
The clean thing about keeping it inline: no filesystem, no folder conventions, no file-not-found failure mode. The template is the data. That makes it ideal for sharing workflows - someone opens your graph and sees exactly which options are on the table, no hidden .txt files to hunt down.
Inputs and outputs
Two inputs, that's it:
- template (multiline) - your prompt with
{a|b|c}groups. The default is a friendlya {red|blue|green} {car|bicycle}, {sunny|rainy} dayso you can test on the first click. - seed - lock it for reproducibility, randomize it for variety.
One output: prompt, a resolved STRING. Wire it into a CLIP Text Encode (convert that node's text widget to an input first). That's the entire surface area - about as beginner-friendly as this pack gets.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/TensorVizion/OmniNodes
Restart ComfyUI; find Wildcard Prompt Builder π§© under TensorVizion/Prompt. No extra dependencies at all - pure Python, no folder_paths, no pip installs.
Where people get burned
- It does not touch wildcard files. Type
__color__in here and it stays literal text - that syntax belongs to Wildcard Loader. If you need file-based tokens, you want the other node. They're siblings, not substitutes, and the README is careful to frame them that way. - Seed 0 is a fixed seed. Leave the default and you'll see the same combination every run. That trips people constantly - the node isn't randomizing for you; you have to randomize the seed.
- Every run re-picks. There's no "lock this option and only vary that one" widget. For a single locked slot, you'd pull that value out into a separate fixed string and combine them with a prompt combiner.
For quick, self-contained variation - character reference libraries, style tests, seed ladders - this is the node to reach for. It's the simplest thing in the prompt category, and simple is the feature.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| template | STRING | a {red|blue|green} {car|bicycle}, {sunny|rainy} day | β |
| seed | INT | 00β18446744073709550000 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | β |