MUSimpleWildcard
The 'simple' wildcard node with a scripting language hidden inside
- STRING
The name undersells this one hard. MUSimpleWildcard looks like a plain dynamic-prompt node - text in, expanded string out, a seed to control the randomness. Then you read the README and it turns out to be a full mini-language: wildcards, variables, user-defined functions, filters, seed offsets, LoRA tag extraction, even a built-in $help() command. "It does more than its name implies" is the author's own understatement.
The part you'll actually use day one is the wildcard syntax: $name$ in your prompt looks up name.txt and picks a random line. Where does it look? Whatever MU_WILDCARD_BASEDIR points to (default: a wildcards folder under your working directory - and yes, that means it's relative to where you launched ComfyUI, so set the env var if ComfyUI isn't finding your files). One line per wildcard option, blank lines skipped. From there it escalates fast:
- Filters:
$name:filter:!filter2$- every term must match (case-sensitive), a leading!means "must not match". Great for one file that holds both SFW and NSFW lines. - Seed offsets:
$name+n$shifts the RNG so you can lock most of a prompt while randomizing one slot. $LORA$: a magic wildcard that returns every LoRA ComfyUI knows about, filterable like any other.- Delayed evaluation:
$?name$waits until after variables/functions are expanded before picking. - Variables and functions:
$z = realistic, photo, then$foo($a, $b=sporty) = { $c, $z, a $b $a }and call it. Functions can nest, variables are local to their function, and you can define them anywhere in the prompt. There's also a set of defaults -$ascseq,$descseq,$warmlora,$coollora,$weightfor scheduling LoRA strengths across a sequence, plus$help()to list them all. Defaults load at startup and are governed by theMU_WILDCARD_INCLUDEenv var; the magic string$debugwcforces a reload.
Under the hood it's not simple at all: a real Lark parser (lark is a dependency, alongside jinja2 for expression evaluation) and a registered prompt handler that expands everything before encoding. That last bit matters - the node's actual doit just returns text; the magic happens in a pre-prompt hook the pack installs when it imports.
The inputs you'll set: text (multiline - your template), seed (drives all the random choices), and one genuinely useful optional, use_pnginfo. Tick that box and the expanded result gets cached in the workflow's pnginfo, so re-running with the same seed gives you the same expansion instead of re-rolling. Handy when you've locked a look and want reruns to be reproducible.
Wire the STRING output into CLIPTextEncode and you've got dynamic prompts. Two early traps: the working-directory wildcard base (set MU_WILDCARD_BASEDIR explicitly), and remembering this is a different syntax from the {a|b|c} style used by Impact Pack's dynamic prompts - $name$ here, not braces.
Install via ComfyUI Manager (search "comfyui-utility-nodes") or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/asagi4/comfyui-utility-nodes
cd comfyui-utility-nodes
pip install -r requirements.txt
Restart, find it under "misc-utils". If you want chaotic prompt variation with a proper scripting escape hatch, it's the most capable "simple" node in the pack - and honestly, in most of ComfyUI.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| seed | INT | 00–18446744073709550000 | — |
| use_pnginfoopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |