π€ CYH Prompt Tools | Wildcard Generator
Roll the dice on your prompts, on a seed
- randomized_prompt
{beautiful|stunning|gorgeous} - wildcard prompts are the cheap way to explore variations: write a template with options, let the machine pick one at random, and generate a spread of images that differ in controlled ways. This node does exactly that replacement, one-shot, with a seed so you can reproduce a specific roll.
It's the newest tool in the Chye ComfyUI Toolset's prompt_tools family (added in v2.10.0). The README frames it as a wildcard substitute for "models without native wildcard support," and that's the honest use case: ComfyUI's built-in dynamic-prompt system watches files and generates on the fly, whereas this is a self-contained text transform.
How it works
It scans your prompt for {option1|option2|option3} expressions, splits each on |, and picks one option at random per expression, then substitutes:
wildcard_pattern = r'\{([^{}]+)\}'
options = [opt.strip() for opt in match.split('|')]
selected = random.choice(options)
"A {beautiful|stunning|gorgeous} {landscape|cityscape|seascape}" becomes, say, "A stunning seascape." Nested or overlapping braces aren't handled - it's deliberately simple.
The inputs
- prompt (multiline) - your text with
{a|b|c}wildcards. The default demonstrates the syntax. - seed (0 to ~1.8e19) - here's the thing worth knowing: the node calls
random.seed(seed)unconditionally, so any seed - including 0 - gives you a deterministic, reproducible pick. The README says "0 for random," but the code disagrees: seed 0 is just another fixed seed, and the same input on the same seed always rolls the same options. If you want genuinely random output every run, you'd want to vary the seed - but with this node, don't set 0 expecting chaos.
Output: randomized_prompt (STRING), which you'd wire into your CLIP/text-encoder input. The output node forces execution every run, so it re-rolls each time you hit queue (with a fixed seed it re-rolls to the same result - which is the point of seeding).
Where it sits
Two natural homes: a variation grid (seed the node, batch up, and get the same wildcard roll for every image in the batch - good for comparing samplers), or a random roll (vary the seed each run for surprise). Compared to the full dynamic-prompts ecosystem, this is a light tool: no external text files, no recursive wildcard files, no special syntax beyond {a|b|c}. That's a feature if you just want the simple version.
Install
ComfyUI Manager (search "Chye ComfyUI Toolset"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/chyer/Chye-ComfyUI-Toolset
cd Chye-ComfyUI-Toolset
pip install -r requirements.txt
Restart after. Pure-Python, no per-node dependencies. Zip installs need .git/.cnr-id (Chye-ComfyUI-Toolset) per the README.
Verdict
For quick prompt roulette with reproducible results, it does the job with zero setup. Just remember the seed semantics (0 is deterministic here, README claims otherwise) and that it's one-shot - if you want file-driven wildcards with infinite nesting, you want the established dynamic-prompts pack instead. Different tools for different amounts of wildcard.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | A {beautiful|stunning|gorgeous} {landscape|cityscape|seascape} with {sunset|sunrise|clouds} | β |
| seed | INT | 00β18446744073709550000 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| randomized_prompt | STRING | β |