Cyberdelia Wildcard Prompts
One random prompt per run, no LLM involved
- prompts
- preview
- prompt_count
The pack this node lives in is advertised as an LLM prompt engineer - it talks to LM Studio or Ollama and rewrites what you typed. Wildcard Prompts is the part that never calls anything. No server, no key, no model discovery. It reads templates you wrote, fills in your tags, and hands one over per run. It's the odd one out in the pack, and the one you'll actually leave in the graph.
Where it fits
Prompt variety has three established answers in ComfyUI: old A1111 bracket syntax ({brown|blonde|black}), which most people who arrived after 2024 never learned; __wildcard__ file processing, which a lot of workflows get from Impact Pack without realising it; and the current fashion of letting a local LLM rewrite your prompt until it stops being the same face.
Wildcards are the cheap one. Testing a character LoRA, a style LoRA or a fresh checkpoint means wanting the same trigger word against twelve scenes - cafe, rooftop, studio, golden hour - stored in a file you edit between runs instead of retyped in the browser.
How it works
Everything runs in order, inside one node. Your prompts text (or a .txt file) is split into blocks. {tag} placeholders are substituted from extra_tags, and a tag you never defined - or defined as empty - is deleted with the spacing cleaned up, so A portrait of a {type} woman. becomes A portrait of a woman., not A portrait of a woman. Then search_replace rules run in the order you wrote them, then prefix goes on the front.
The last step is what changes your workflow. mode: random prompt outputs a single-item list picked by random.Random(prompt_seed). mode: all prompts outputs every block as a list - and since prompts is the pack's only list output, one queue in that mode runs everything downstream once per prompt. Ten prompts, ten images, ten sampler passes; prompt_count tells you how many you just signed up for.
Selection uses its own random generator, seeded from prompt_seed alone, so rolling a prompt can't disturb your sampler's seed state. A fixed seed repeats the same pick, and the author's own note is that a random draw can land on a prompt you already saw.
The controls that matter
promptsandextra_tagsare the two required fields. Tags are onename=valueper line (hair=blonde); lines starting with#are ignored.prompt_separator-blank lineif a prompt can span several lines,one per lineif each line is its own prompt.mode,prompt_seed- see above. Setprompt_seed'scontrol_after_generatedropdown torandomizefor a new draw each run.enabledis the switch you'll use most. Off, and the node sendsfallback_promptonce, unchanged: templates, tags, search/replace, prefix and the file path are all skipped. Keep your normal prompt in there and you can A/B the wildcard against a fixed prompt without rewiring anything.
Outputs are prompts, preview (text only; in all-prompts mode, everything joined) and prompt_count. Wire prompts to the text input of Prompt Engineer - Text or Conditioning, or straight to an encoder. Keep Prompt Engineer in passthrough to test the selected prompt with no rewriting.
Install
Via ComfyUI Manager, search Cyberdelia, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/cyberdeliaAI/comfyui-cyberdelia-z-engineer.git
pip install -r comfyui-cyberdelia-z-engineer/requirements.txt
That requirements file is one line - requests - and it's for the pack's LLM nodes, not for this one. Coming from the standalone comfyui-wildcard-lora package: remove it, restart, hard-refresh the browser. The node ID was kept, so old workflows still load.
Where people get burned
It sends the same prompt every run. Classic ComfyUI caching - an unchanged node isn't re-executed, and this one reports prompt_seed as its change signal. Randomising the seed is what makes it re-roll; leave it fixed and you test exactly one prompt, forever.
prompt_file isn't the Load .txt button. The path is read on the ComfyUI machine, relative to ComfyUI/input, and must be .txt or it errors. The button reads a file in your browser, and it clears prompt_file when it does, folding the text into the workflow. Silent source swap.
Some mistakes stop the queue instead of warning. A tag name defined twice, a line missing its =, or a search/replace rule that empties a whole prompt all raise. Deliberate: a run that quietly produced eleven prompts instead of twelve is worse than one that stops.
Whole-word matching is on by default, so woman=male won't touch superwoman - I checked. Right default, and also why your replacement "doesn't work" when you wanted a substring; flip replace_match to literal text.
It doesn't expand {a|b|c}. Bracket syntax is a different mechanism, and these fields are flagged so the dynamic-prompts frontend extension leaves them alone. It also won't vary LoRA strength, steps or samplers - only text - so pairing a wildcard sweep with an X/Y plot is normal, not redundant.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| prompts | STRING | A studio portrait of an adult {type} woman with {hair} hair, soft lighting. An adult {type} woman with {hair} hair, walking through a city, daylight. An adult {type} woman with {hair} hair, wearing a sweater, sitting in a cafe. | Paste prompts here. Use {hair} tags or choices such as {red|brown|black}. Choose blank-line separation or one prompt per line with prompt_separator. Lines starting with # are comments. |
| extra_tags | STRING | hair=blonde type=mature | Define tags here, one name=value per line. Values can use choices, e.g. hair={red|brown|black}; each tag is chosen once per run. Missing or empty tags are removed from the prompt. |
| prompt_fileopt | STRING | Optional .txt path on the ComfyUI computer. Overrides pasted prompts. Relative to ComfyUI/input. Files must be inside the input folder or a folder listed in CYBERDELIA_Z_ENGINEER_PROMPT_DIRS. | |
| prompt_separatoropt | COMBO | blank line | Blank line lets each prompt span multiple lines. One per line treats each non-empty line as a separate prompt. |
| search_replaceopt | STRING | One search=replacement per line, e.g. straight hair={red|brown|black} hair. Choices are selected once per rule. Rules run after filling tags. An empty replacement deletes the matched text. | |
| replace_matchopt | COMBO | whole words | Whole words avoids replacing woman inside superwoman. Literal text matches anywhere. Search text is always literal, never a regular expression. |
| case_sensitiveopt | BOOLEAN | false | When disabled, woman also matches Woman and WOMAN. Replacement text is inserted exactly as entered. |
| prefixopt | STRING | Optional keyword or text at the beginning of the final prompt. Empty ignores it. Can use {trigger} tags or {red|brown|black} choices. Added after search/replace. | |
| modeopt | COMBO | random prompt | Random prompt chooses one prompt per run. Sequential prompt sends the next prompt per queued workflow. All prompts is the existing list mode: every prompt block in one workflow. |
| prompt_seedopt | INT | 00–4294967295 | Controls prompt selection and {red|brown|black} choices. Set its control_after_generate to randomize for new draws each run, or fixed to repeat the result. |
| enabledopt | BOOLEAN | true | Turn off to send fallback_prompt once, unchanged. Prompt files, tags, replacements, prefix and selection are ignored while off. |
| fallback_promptopt | STRING | Normal prompt used when wildcards are off. Enter it here, or connect the prompt output of Cyberdelia Prompt Controls. An empty value sends one empty prompt. | |
| repeat_listopt | BOOLEAN | false | Sequential mode only. Off skips the dependent generation chain after the last prompt; on repeats the list from the beginning. |
| sequence_indexopt | INT | 00–4294967295 | Sequential mode only. Zero selects the first prompt. Advances after each successful queue submission in the UI, also when promoted to a subgraph. Reset sequence starts over. API clients must increment this input themselves. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| prompts | STRING | — |
| preview | STRING | — |
| prompt_count | INT | — |