Nodes/ComfyUI-ChomfyNodes/Chomfy Mega Wildcard Builder (24 Lines)
ComfyUI Node

Chomfy Mega Wildcard Builder (24 Lines)

Turn one prompt into a thousand, no LLM required

By chchchadzilla·Created about a year ago·Updated 5 months ago· 2
Chomfy Mega Wildcard Builder (24 Lines)
    • final_prompt
    ◄seed0►
    ◄on_01true►
    ◄file_01▾►
    ◄mode_01▾►
    ◄index_010►
    ◄join_01, ►
    ◄on_02true►
    ◄file_02▾►
    ◄mode_02▾►
    ◄index_020►
    ◄join_02, ►
    ◄on_03true►
    ◄file_03▾►
    ◄mode_03▾►
    ◄index_030►
    ◄join_03, ►
    ◄on_04true►
    ◄file_04▾►
    ◄mode_04▾►
    ◄index_040►
    ◄join_04, ►
    ◄on_05true►
    ◄file_05▾►
    ◄mode_05▾►
    ◄index_050►
    ◄join_05, ►
    ◄on_06true►
    ◄file_06▾►
    ◄mode_06▾►
    ◄index_060►
    ◄join_06, ►
    ◄on_07true►
    ◄file_07▾►
    ◄mode_07▾►
    ◄index_070►
    ◄join_07, ►
    ◄on_08true►
    ◄file_08▾►
    ◄mode_08▾►
    ◄index_080►
    ◄join_08, ►
    ◄on_09true►
    ◄file_09▾►
    ◄mode_09▾►
    ◄index_090►
    ◄join_09, ►
    ◄on_10true►
    ◄file_10▾►
    ◄mode_10▾►
    ◄index_100►
    ◄join_10, ►
    ◄on_11true►
    ◄file_11▾►
    ◄mode_11▾►
    ◄index_110►
    ◄join_11, ►
    ◄on_12true►
    ◄file_12▾►
    ◄mode_12▾►
    ◄index_120►
    ◄join_12, ►
    ◄on_13true►
    ◄file_13▾►
    ◄mode_13▾►
    ◄index_130►
    ◄join_13, ►
    ◄on_14true►
    ◄file_14▾►
    ◄mode_14▾►
    ◄index_140►
    ◄join_14, ►
    ◄on_15true►
    ◄file_15▾►
    ◄mode_15▾►
    ◄index_150►
    ◄join_15, ►
    ◄on_16true►
    ◄file_16▾►
    ◄mode_16▾►
    ◄index_160►
    ◄join_16, ►
    ◄on_17true►
    ◄file_17▾►
    ◄mode_17▾►
    ◄index_170►
    ◄join_17, ►
    ◄on_18true►
    ◄file_18▾►
    ◄mode_18▾►
    ◄index_180►
    ◄join_18, ►
    ◄on_19true►
    ◄file_19▾►
    ◄mode_19▾►
    ◄index_190►
    ◄join_19, ►
    ◄on_20true►
    ◄file_20▾►
    ◄mode_20▾►
    ◄index_200►
    ◄join_20, ►
    ◄on_21true►
    ◄file_21▾►
    ◄mode_21▾►
    ◄index_210►
    ◄join_21, ►
    ◄on_22true►
    ◄file_22▾►
    ◄mode_22▾►
    ◄index_220►
    ◄join_22, ►
    ◄on_23true►
    ◄file_23▾►
    ◄mode_23▾►
    ◄index_230►
    ◄join_23, ►
    ◄on_24true►
    ◄file_24▾►
    ◄mode_24▾►
    ◄index_240►
    ◄join_24, ►

    The fastest way to hate batch generation is to sit there watching a hundred images of the exact same thing roll off your GPU. Chomfy Mega Wildcard Builder is the fix: 24 independent slots, each pulling a line from your own .txt or .csv file, and everything gets stitched into one prompt before it ever reaches the text encoder. It's the old A1111 wildcard idea - the {blonde|brunette|redhead} bracket trick - taken to 24 curated slots.

    Where it fits: this is the controlled-variety end of prompt engineering. An LLM rewrites every prompt and you get random soup; wildcards randomize inside a vocabulary you chose, which is exactly what you want for character reference libraries, lighting and mood tests, or any batch where you need the same person across different cameras. The KB's own prompting essay calls the bracket trick "old A1111 wildcard syntax that most people arriving after 2024 never learned" - this node is that same syntax with training wheels.

    How it works

    Your wildcard files live in ComfyUI-ChomfyNodes/wildcards/. Drop hair.txt, lighting.csv, whatever, and each slot gets a dropdown listing them. Every slot has the same five controls: an ON/OFF toggle, the file, a mode, an index, and a join delimiter.

    The seed input drives everything, and the modes are where the node gets interesting:

    • Random - picks a random line, but deterministically per slot. Each slot seeds off seed + slot_number * 100, so the same seed always gives the same combo. Change the seed, get a fresh roll.
    • Fixed - grabs the exact line at index. The one you use when a slot is a constant you don't want to retype.
    • Sequential Forward / Reverse - walks the file forward or backward as the seed increments ((index + seed) % line_count). Bump the seed by one per image and the prompt steps through your file in order - a poor man's storyboard.

    Between active slots it inserts the join_XX delimiter (default , ), so the final prompt reads like a normal comma-joined prompt. The first slot doesn't get a leading delimiter.

    The inputs you actually touch

    Two dozen slots is a lot of dials, but you mostly live in three per slot: the file dropdown, the mode, and the index. Set the rest and forget them. The one input at the top of the node - seed - is the thing you'll be bumping constantly.

    The single output, final_prompt, is a plain STRING. Wire it into the positive input of a CLIPTextEncode (or whatever your model's text encoder node is) and queue a batch.

    Installing it

    ComfyUI Manager is the easy route - search for ComfyUI-ChomfyNodes and hit install. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/chchchadzilla/ComfyUI-ChomfyNodes.git
    

    Restart ComfyUI. The pack has no requirements.txt - it's pure Python using only what ComfyUI already ships, so there's nothing extra to pip install.

    Where people get burned

    The classic trap: you put your wildcard files somewhere sensible like your main wildcards/ folder and the dropdown shows nothing. Files must go in this pack's own wildcards/ directory. The dropdown is also built when ComfyUI loads, so if you add a file and it doesn't appear, restart - not a bug, just when the list gets read.

    A slot with no file selected shows none.txt as a placeholder and silently skips. And remember Sequential mode is tied to the seed: if your seed is frozen, "Sequential" behaves like "Fixed" no matter how many times you run it. Change the seed to make it walk.

    CategoryChomfyNodes

    Inputs (121)

    NameTypeDefaultDescription
    seedINT00–18446744073709550000—
    on_01BOOLEANtrue—
    file_01COMBO1 options: none.txt
    mode_01COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_01INT00–10000—
    join_01STRING, —
    on_02BOOLEANtrue—
    file_02COMBO1 options: none.txt
    mode_02COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_02INT00–10000—
    join_02STRING, —
    on_03BOOLEANtrue—
    file_03COMBO1 options: none.txt
    mode_03COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_03INT00–10000—
    join_03STRING, —
    on_04BOOLEANtrue—
    file_04COMBO1 options: none.txt
    mode_04COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_04INT00–10000—
    join_04STRING, —
    on_05BOOLEANtrue—
    file_05COMBO1 options: none.txt
    mode_05COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_05INT00–10000—
    join_05STRING, —
    on_06BOOLEANtrue—
    file_06COMBO1 options: none.txt
    mode_06COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_06INT00–10000—
    join_06STRING, —
    on_07BOOLEANtrue—
    file_07COMBO1 options: none.txt
    mode_07COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_07INT00–10000—
    join_07STRING, —
    on_08BOOLEANtrue—
    file_08COMBO1 options: none.txt
    mode_08COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_08INT00–10000—
    join_08STRING, —
    on_09BOOLEANtrue—
    file_09COMBO1 options: none.txt
    mode_09COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_09INT00–10000—
    join_09STRING, —
    on_10BOOLEANtrue—
    file_10COMBO1 options: none.txt
    mode_10COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_10INT00–10000—
    join_10STRING, —
    on_11BOOLEANtrue—
    file_11COMBO1 options: none.txt
    mode_11COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_11INT00–10000—
    join_11STRING, —
    on_12BOOLEANtrue—
    file_12COMBO1 options: none.txt
    mode_12COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_12INT00–10000—
    join_12STRING, —
    on_13BOOLEANtrue—
    file_13COMBO1 options: none.txt
    mode_13COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_13INT00–10000—
    join_13STRING, —
    on_14BOOLEANtrue—
    file_14COMBO1 options: none.txt
    mode_14COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_14INT00–10000—
    join_14STRING, —
    on_15BOOLEANtrue—
    file_15COMBO1 options: none.txt
    mode_15COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_15INT00–10000—
    join_15STRING, —
    on_16BOOLEANtrue—
    file_16COMBO1 options: none.txt
    mode_16COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_16INT00–10000—
    join_16STRING, —
    on_17BOOLEANtrue—
    file_17COMBO1 options: none.txt
    mode_17COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_17INT00–10000—
    join_17STRING, —
    on_18BOOLEANtrue—
    file_18COMBO1 options: none.txt
    mode_18COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_18INT00–10000—
    join_18STRING, —
    on_19BOOLEANtrue—
    file_19COMBO1 options: none.txt
    mode_19COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_19INT00–10000—
    join_19STRING, —
    on_20BOOLEANtrue—
    file_20COMBO1 options: none.txt
    mode_20COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_20INT00–10000—
    join_20STRING, —
    on_21BOOLEANtrue—
    file_21COMBO1 options: none.txt
    mode_21COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_21INT00–10000—
    join_21STRING, —
    on_22BOOLEANtrue—
    file_22COMBO1 options: none.txt
    mode_22COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_22INT00–10000—
    join_22STRING, —
    on_23BOOLEANtrue—
    file_23COMBO1 options: none.txt
    mode_23COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_23INT00–10000—
    join_23STRING, —
    on_24BOOLEANtrue—
    file_24COMBO1 options: none.txt
    mode_24COMBO4 options: Random, Fixed, Sequential Forward, Sequential Reverse
    index_24INT00–10000—
    join_24STRING, —

    Outputs (1)

    NameTypeDescription
    final_promptSTRING—