Nodes/ComfyUI-Animagine-Prompt/Multi-Wildcard Loader
ComfyUI Node

Multi-Wildcard Loader

Five wildcard files, combined two different ways

By gmorks·Created 2 years ago·Updated about a year ago· 16
Multi-Wildcard Loader
    • combined_text
    • preview_text
    modeslots
    template_text{expressions.txt} {poses.txt} wearing {clothing.txt} in a {scenarios.txt}
    separator,
    seed-1
    wildcard_1_path
    wildcard_1_enabledtrue
    wildcard_1_line_index-1
    wildcard_2_path
    wildcard_2_enabledtrue
    wildcard_2_line_index-1
    wildcard_3_path
    wildcard_3_enabledtrue
    wildcard_3_line_index-1
    wildcard_4_path
    wildcard_4_enabledtrue
    wildcard_4_line_index-1
    wildcard_5_path
    wildcard_5_enabledtrue
    wildcard_5_line_index-1

    If Wildcards Text File Loader is one list, one pick, this is five lists at once - expressions, poses, clothing, scenarios, whatever you split your prompt building blocks into - combined into a single string two different ways depending on how much control you want over the sentence structure.

    Why you'd reach for it

    Once you've outgrown a single wildcard file - you're building prompts out of separate parts like "expression + pose + clothing + scene" rather than one flat list - stitching five Wildcards Text File Loader nodes together by hand gets tedious fast. This node folds that into one place: five independent wildcard slots, each individually toggled and seeded, plus a way to control exactly how they get glued together into a sentence instead of just concatenated in order.

    How it works

    Pick a mode: slots (the default) or template.

    Slots mode uses the five wildcard_1 through wildcard_5 groups: each has its own _path (the .txt file), _enabled (on by default - flip it off to leave that slot out of the result entirely), and _line_index (-1 for random, or a fixed index if you want that one slot locked while the others vary). Whatever's enabled gets joined together with separator (default ", ").

    Template mode hands you the wiring instead: template_text is a string with {filename.txt}-style placeholders that get replaced by a picked line from the matching file. The default example shows the idea - {expressions.txt} {poses.txt} wearing {clothing.txt} in a {scenarios.txt} - which is the thing slots mode can't do on its own: control the connective words ("wearing", "in a") around each wildcard pick instead of just separator-joining them in sequence.

    seed governs the random resolution across whichever slots or placeholders are in play, same -1-for-random convention as the pack's other nodes.

    Inputs and outputs

    What you'll actually touch: mode, then either the five wildcard_N_path fields (slots mode) or template_text (template mode), and seed. separator is worth knowing about but rarely needs changing from its default.

    Two outputs: combined_text, the assembled result you wire downstream into a CLIPTextEncode or into Animagine Prompt's prompt fields, and preview_text - a second copy of the same text meant for hooking to a text-display node. That second output earns its keep the moment you're randomizing five files at once and have no other way to see what a given batch actually rolled without digging through the generated image's embedded prompt.

    Installing it

    Bundled with the pack, no separate install. ComfyUI Manager: search ComfyUI-Animagine-Prompt. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/gmorks/ComfyUI-Animagine-Prompt
    

    then restart. Same as the pack's other text nodes: no model downloads, nothing heavy.

    Where people get burned

    The seed/caching trap that applies to every random-pick node in this pack matters more here, because five files' worth of picks are riding on it: if outputs feel stuck between runs, right-click seed and set "control after generate" to randomize. In slots mode, remember that only enabled slots feed the output - toggling wildcard_N_enabled off is how you drop a slot, rather than clearing its path. And a practical note: this is the newest, least-battle-tested node in the pack - it currently gets essentially no search traffic, which tracks with it being a recent addition rather than something with years of bug reports behind it. If template mode does something unexpected with a filename placeholder, check the pack's GitHub issues before assuming you did something wrong; there just isn't much of a public track record on this one yet.

    CategoryAnimagine-Prompt

    Inputs (19)

    NameTypeDefaultDescription
    modeCOMBOslotsSlots: Use individual wildcard slots. Template: Use template with {filename.txt} placeholders
    template_textSTRING{expressions.txt} {poses.txt} wearing {clothing.txt} in a {scenarios.txt}
    separatorSTRING,
    seedINT-1-1–4294967295Seed for random selection (-1 for time-based seed)
    wildcard_1_pathoptSTRING
    wildcard_1_enabledoptBOOLEANtrue
    wildcard_1_line_indexoptINT-1Line index for wildcard 1 (-1 for random)
    wildcard_2_pathoptSTRING
    wildcard_2_enabledoptBOOLEANtrue
    wildcard_2_line_indexoptINT-1Line index for wildcard 2 (-1 for random)
    wildcard_3_pathoptSTRING
    wildcard_3_enabledoptBOOLEANtrue
    wildcard_3_line_indexoptINT-1Line index for wildcard 3 (-1 for random)
    wildcard_4_pathoptSTRING
    wildcard_4_enabledoptBOOLEANtrue
    wildcard_4_line_indexoptINT-1Line index for wildcard 4 (-1 for random)
    wildcard_5_pathoptSTRING
    wildcard_5_enabledoptBOOLEANtrue
    wildcard_5_line_indexoptINT-1Line index for wildcard 5 (-1 for random)

    Outputs (2)

    NameTypeDescription
    combined_textSTRING
    preview_textSTRING