IF Display Text Wildcard📟
Turn one prompt into endless variations
- text
- text_list
- count
- selected
IF Display Text Wildcard is the prompt-variation machine of the IF_AI pack. If you've used wildcard systems in other ComfyUI packs - where __clothing__ in a prompt randomly expands to "dress", "jeans" or "leather jacket" - this is that idea, scoped to the IF ecosystem and fed by YAML/JSON files. You give it a template with placeholders and it hands back a concrete string, then a different one next run, then another. For anyone generating character or style batches where repeating the same prompt is the enemy, this is the node.
It's also a superset of IF Display Text: same four outputs, same line-splitting, plus wildcard expansion and a counter that lets you step through variants deterministically when you want reproducibility instead of randomness.
How it works
On startup the node loads every YAML and JSON file from the pack's IF_AI/presets/wildcards folder and flattens them into a dictionary of key → list of values. __key__ placeholders in your text get replaced with a randomly chosen value from the matching list. Nested dictionaries become composite keys (parent/child), and wildcard_mode changes the behavior so that if no match is found, execution gets blocked entirely (via ComfyUI's ExecutionBlocker) rather than passing through a broken template.
The dynamic_prompt input adds ad-hoc inline wildcards with {val1|val2} syntax - no file needed. max_variants caps how many combinations get generated, and counter/select let you drive through variants in a fixed order instead of rolling the dice every run.
The inputs that matter
text- your template with__wildcard__placeholders.dynamic_prompt- inline{choice1|choice2}variables.wildcard_mode- toggle strict blocking when a wildcard isn't found.counter/select- deterministic stepping vs. random selection.
Outputs mirror IF Display Text: text (the expanded full string), text_list, count, and selected.
Installation
Standard for the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/if-ai/ComfyUI-IF_AI_tools.git
pip install -r requirements.txt
Or "IF_AI_tools" via ComfyUI Manager and restart. Your own wildcard files go in ComfyUI/custom_nodes/ComfyUI-IF_AI_tools/IF_AI/presets/wildcards/.
Gotchas
Two things to know. The wildcards directory only holds what ships with the pack plus what you add - there's no huge community library bundled, so you'll be writing your own YAML. And since the node reads those files at construction time, a freshly added wildcard file requires a node refresh (or ComfyUI restart) before it shows up. If you're already running a dedicated wildcard pack, this one is somewhat redundant - reach for it when you want variation inside an IF-heavy workflow without adding another dependency. The pack is archived, but wildcard YAML is eternal.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| select | INT | 00–9223372036854776000 | — |
| counter | INT | -1-1–999999 | — |
| dynamic_promptopt | STRING | — | |
| max_variantsopt | INT | 101–1000 | — |
| wildcard_modeopt | BOOLEAN | false | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| text_list | STRING | — |
| count | INT | — |
| selected | STRING | — |