Nodes/ComfyUI Impact Pack/ImpactWildcardProcessor
ComfyUI Node Runs on cloud

ImpactWildcardProcessor

Dynamic prompts and wildcards, resolved to plain text

By ltdrdata·Created 4 years ago·Updated about 7 hours ago· 3,397
ImpactWildcardProcessor
    • processed text
    ◄wildcard_text—►
    ◄populated_text—►
    ◄modepopulate►
    ◄seed0►
    ◄Select to add Wildcard▾►

    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 (default populate) - populate rerolls each run, fixed freezes the populated text, reproduce rebuilds 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.

    CategoryImpactPack/Prompt

    Inputs (5)

    NameTypeDefaultDescription
    wildcard_textSTRINGEnter a prompt using wildcard syntax.
    populated_textSTRINGThe 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'.
    modeCOMBOpopulatepopulate: 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. Fixed also pauses automatic seed changes, including choices in populated_text. Use populate for automatic variation.
    seedINT00–18446744073709550000Determines the random seed to be used for wildcard processing.
    Select to add WildcardCOMBO1 options: Select the Wildcard to add to the text

    Outputs (1)

    NameTypeDescription
    processed textSTRING—