ImpactWildcardProcessor
Dynamic prompts and wildcards, resolved to plain text
- processed text
ImpactWildcardProcessor turns prompt templates into finished prompts. Write a __color__ car, {photo|painting|sketch} of a city, run it, and out comes a red car, photo of a city - one concrete prompt, with the wildcards filled and the {a|b|c} choices rolled. It's the Impact Pack's take on the dynamic-prompts idea that A1111 users know from the sd-dynamic-prompts extension, packaged as a node that outputs plain text you can wire into any CLIP encoder.
If you've ever wanted a prompt that varies every run - random outfits, random lighting, random styles - this is the clean way to do it in ComfyUI. It outputs a string, so it drops in front of whatever you already use to encode prompts. (Its sibling ImpactWildcardEncode bundles the CLIP encode and LoRA loading into the same node; reach for the Processor when you just want the resolved text and nothing else.)
How it works
The node supports two syntaxes. __wildcard-name__ pulls a random line from a matching .txt or .yaml file in the pack's wildcards or custom_wildcards folder - so __color__ reads color.txt and picks one. {a|b|c} is inline dynamic prompting: pick one of the pipe-separated options right there in the text. You can nest them. The mode widget decides when the roll happens, and this is the part that trips people up: in populate mode it rerolls every execution and writes the result into the second textbox; in fixed mode it leaves that second textbox alone so the same prompt runs every time; reproduce re-derives a past result from its seed. The seed drives the randomness, so a fixed seed gives a repeatable roll.
The inputs and outputs that matter
wildcard_text(required) - your template, with__wildcards__and{a|b|c}syntax. This is the box you write in.populated_text(required) - the resolved output, shown before execution and saved with the workflow. In populate mode the node overwrites this for you; in fixed mode you edit it directly and it's what actually runs.mode(defaultpopulate) -populatererolls each run,fixedfreezes the populated text,reproducerebuilds from seed. The setting to understand first.seed(default 0) - the randomness source. Lock it to repeat a roll; randomize it to vary each run.
There's also a "Select to add Wildcard" helper dropdown for inserting available wildcard names. Single output: processed text (a STRING) - feed it into a CLIP Text Encode, a Power Prompt, or anywhere a prompt string is accepted.
How to install it
Install the pack via ComfyUI Manager (search ComfyUI Impact Pack, install, restart), or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack comfyui-impact-pack
cd comfyui-impact-pack
python -m pip install -r requirements.txt # ComfyUI's python; python_embeded on portable
then restart. No models needed. To use __wildcards__, drop .txt or .yaml files into ComfyUI-Impact-Pack/wildcards (or custom_wildcards) - there are big ready-made collections like the "billions of wildcards" YAML pack on CivitAI. After the first run, an impact-pack.ini is created where you can repoint custom_wildcards to your own folder.
Common issues & troubleshooting
My prompt won't change between runs. You're in fixed mode, which is the whole point of that mode - it freezes populated_text. Switch to populate to reroll each execution. This populate-vs-fixed confusion is the single most common wildcard question.
__something__ came through literally as text. No wildcard file matched. The name has to match a .txt/.yaml filename in your wildcards folder - __color__ needs color.txt. Check the file exists and restarted ComfyUI picked it up.
I want the exact prompt that made a good image. In populate mode, the resolved prompt is written into populated_text and saved with the workflow, so it's recoverable after the fact. If you're driving the seed from an input, write your prompt directly into populated_text and set mode to fixed, per the node's own tip, so the seed doesn't reroll it out from under you.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| wildcard_text | STRING | Enter a prompt using wildcard syntax. | |
| populated_text | STRING | The actual value passed during the execution of 'ImpactWildcardProcessor' is what is shown here. The behavior varies slightly depending on the mode. Wildcard syntax can also be used in 'populated_text'. | |
| mode | COMBO | populate | populate: Before running the workflow, it overwrites the existing value of 'populated_text' with the prompt processed from 'wildcard_text'. In this mode, 'populated_text' cannot be edited. fixed: Ignores wildcard_text and keeps 'populated_text' as is. You can edit 'populated_text' in this mode. reproduce: This mode operates as 'fixed' mode only once for reproduction, and then it switches to 'populate' mode. |
| seed | INT | 00–18446744073709550000 | Determines the random seed to be used for wildcard processing. |
| Select to add Wildcard | COMBO | 1 options: Select the Wildcard to add to the text |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| processed text | STRING | — |