AUN Wildcard Add-To-Prompt
Wildcards with a built-in dropdown — no separate wildcard manager needed
- prompt
- populated_text
AUNWildcardAddToPrompt is the text-flavored version of "randomize, then maybe append." You give it a template full of wildcard syntax, it rolls the dice each run, and it conditionally adds the result to your prompt - before or after, with a delimiter, or only 50% of the time if you want the surprise. It's basically the AUN Add-To-Prompt node (AUNAddToPrompt) with a wildcard engine bolted on.
The feature that sets it apart: a dropdown that lists every wildcard token the pack can find, so you can point-and-click instead of memorizing names. That dropdown is populated from the pack's own bundled library - the repo ships roughly 200 .txt wildcard files (artists, actors, adjectives, animals, you name it). If you've used wildcards before and always wanted one less external manager, this is a self-contained take.
How it works
Wildcard processing happens on a local library inside the pack itself. It scans AUN-ComfyUI-Nodes/wildcards/*.txt recursively, treats each file as a list of lines, and rolls a fresh random choice every execution (the node deliberately reports itself as always-changed so the queue never skips it). The syntax it understands:
__token__- pick a random line from the matching file.{a|b|c}- pick one of the inline options.2::moody- weighted options,weight::value.3#__actor__- pick the wildcard that many times, joined by commas.- Nesting works too, up to 24 levels deep, and
#-prefixed lines are treated as comments.
After resolving, it combines the result with your optional prompt using the delimiter, order (prompt first or text first), and mode. Mode is the fun one: on always appends, off never does, and random is a genuine 50/50 coin flip per run.
The inputs and outputs
The ones you actually touch:
- wildcards - your template, multiline. This is where you type
__style__, {soft|moody} lighting, 2#__actor__. - wildcard_selector - the dropdown of discovered tokens. Picking one drops
__token__straight into the template. It refreshes from disk, so files you add show up. - mode - on / off / random.
- prompt (optional) - the base prompt to extend. If you leave it unconnected, the node just processes the wildcard template.
Two outputs: prompt (the combined result - wire this into CLIP Text Encode) and populated_text (the resolved wildcard text alone, handy for a Show Text node or for inspecting what actually got rolled).
The gotcha everyone hits
The wildcard library is local to the pack. It reads AUN-ComfyUI-Nodes/wildcards/, not ComfyUI's root wildcards/ folder, and it does not talk to dynamic-prompts style wildcard setups. So if your favorite custom wildcard isn't in the dropdown, drop its .txt file into the pack's wildcards/ directory and it'll show up. People coming from A1111 or dynamic-prompts expect their existing wildcard folders to "just work" - they don't here, by design.
Installing it
Same pack as the rest of AUN. ComfyUI-Manager → search "AUN" → install, or:
cd custom_nodes
git clone https://github.com/loz2754/AUN-ComfyUI-Nodes
Restart, done. This node is pure Python stdlib plus re, so it doesn't even need the pack's heavier deps (piexif, opencv-python-headless, imageio-ffmpeg) - though Manager will install those regardless, and the pack needs them for its image/video nodes anyway. If you cloned manually and ComfyUI fails to load the pack, pip install -r custom_nodes/AUN-ComfyUI-Nodes/requirements.txt fixes it.
Pair it with an AUN PromptCycler or a text switch and you've got a rotating prompt machine with zero extra moving parts.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| wildcards | STRING | Wildcard template text to add. Supports common wildcard syntax like __name__ and {a|b|c}. | |
| wildcard_selector | COMBO | Quick insert a discovered wildcard token into text_to_add. | |
| delimiter | STRING | , | Delimiter to use between the prompt and the processed text. |
| order | COMBO | prompt_first | Order to use when combining the prompt and the processed text. |
| mode | COMBO | on | Whether to add the processed text: on, off, or random 50/50. |
| promptopt | STRING | Optional prompt to extend. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| populated_text | STRING | — |