Nodes/ComfyUI-IF_AI_tools/IF Display Text Wildcard📟
ComfyUI Node

IF Display Text Wildcard📟

Turn one prompt into endless variations

By if-ai·Created 2 years ago·Updated 12 months ago· 701
IF Display Text Wildcard📟
    • text
    • text_list
    • count
    • selected
    text
    select0
    counter-1
    dynamic_prompt
    max_variants10
    wildcard_modefalse

    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.

    CategoryImpactFrames💥🎞️/IF_tools

    Inputs (6)

    NameTypeDefaultDescription
    textSTRING
    selectINT00–9223372036854776000
    counterINT-1-1–999999
    dynamic_promptoptSTRING
    max_variantsoptINT101–1000
    wildcard_modeoptBOOLEANfalse

    Outputs (4)

    NameTypeDescription
    textSTRING
    text_listSTRING
    countINT
    selectedSTRING