Nodes/IF_LLM/IF Display Text Wildcard📟
ComfyUI Node

IF Display Text Wildcard📟

Randomize Your Prompts Without a Second Pack

By if-ai·Created 2 years ago·Updated about a year ago· 157
IF Display Text Wildcard📟
    • text
    • text_list
    • count
    • selected
    text
    select0
    counter-1
    dynamic_prompt
    max_variants10
    wildcard_modefalse

    Wildcards are the classic way to stop generating the same image on every queue press: stick a token in your prompt, let the node swap it for a random pick from a list, and every run gets a variation. This is the IF_LLM pack's built-in wildcard system - no separate wildcard pack required. It loads its lists from the pack's own IF_AI/presets/wildcards/ folder, which ships with starter sets for Artists, Characters, Clothing, Colors, Props, and more.

    The README lists the wildcard system as a headline feature, and it slots right into the pack's philosophy: this is a kit for building prompt-generation pipelines, and a randomizer is the spice on top.

    How it works

    It's an extension of IF_LLM_DisplayText - same four outputs (text, text_list, count, selected) - but before it displays anything, it runs the text through a substitution pass. Tokens in __keyword__ form get replaced with a random value from the matching wildcard file. Because the files are YAML, you can nest categories, and the syntax supports depth modifiers: __keyword/*__ pulls from immediate subcategories, __keyword/**__ pulls from everything nested under it.

    There's also a dynamic-variables system. The optional dynamic_prompt field takes entries like prefix={val1|val2} - the placeholder in the node itself reads "Enter dynamic variables e.g. prefix={val1|val2}" - and those get merged into the wildcard dictionary, with support for weighted options (2::heavy style weighting).

    The other controls:

    • counter - cycles through generated variants. Step it between runs and you get different picks deterministically instead of pure chaos.
    • max_variants - caps how many variants a single expansion produces (default 10).
    • wildcard_mode - a button toggle that switches between plain text handling and full wildcard expansion.

    Making your own wildcards

    Add a YAML file to custom_nodes/ComfyUI-IF_LLM/IF_AI/presets/wildcards/, like:

    Lighting:
      - golden hour
      - neon glow
      - overcast
      - candlelight
    

    Restart (or re-run) and __lighting__ becomes a live random choice. Missing tokens don't crash the run - the node logs "Wildcard keyword not found" and leaves the text as-is.

    Installing it

    Part of the pack, no separate install. ComfyUI Manager (search "IF_LLM") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/if-ai/ComfyUI-IF_LLM
    

    then restart. Standard pack warnings: conflicts with IF_AI_tools (uninstall it first), and a heavyweight dependency list.

    Troubleshooting

    • Token not replaced - case and spaces matter. The lookup normalizes to lowercase with dashes, so __Golden Hour__ in the file becomes __golden-hour__ as a token. Check your spelling against that.
    • Always the same value - that's the counter/seed interaction. If you want variety per run, let the counter step instead of freezing the selection.
    • My YAML file isn't picked up - confirm the extension is .yaml/.yml/.json and the file is in the wildcards folder, then restart ComfyUI so the node reloads its dictionary.

    If you already use a dedicated wildcard pack, this won't replace your whole setup - but if you're living inside IF_LLM anyway, the wildcards folder is right there, and the randomizer is free.

    CategoryImpactFrames💥🎞️/IF_LLM

    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