Chomfy Mega Wildcard Builder (24 Lines)
Turn one prompt into a thousand, no LLM required
- final_prompt
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.
Inputs (121)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00–18446744073709550000 | — |
| on_01 | BOOLEAN | true | — |
| file_01 | COMBO | 1 options: none.txt | |
| mode_01 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_01 | INT | 00–10000 | — |
| join_01 | STRING | , | — |
| on_02 | BOOLEAN | true | — |
| file_02 | COMBO | 1 options: none.txt | |
| mode_02 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_02 | INT | 00–10000 | — |
| join_02 | STRING | , | — |
| on_03 | BOOLEAN | true | — |
| file_03 | COMBO | 1 options: none.txt | |
| mode_03 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_03 | INT | 00–10000 | — |
| join_03 | STRING | , | — |
| on_04 | BOOLEAN | true | — |
| file_04 | COMBO | 1 options: none.txt | |
| mode_04 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_04 | INT | 00–10000 | — |
| join_04 | STRING | , | — |
| on_05 | BOOLEAN | true | — |
| file_05 | COMBO | 1 options: none.txt | |
| mode_05 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_05 | INT | 00–10000 | — |
| join_05 | STRING | , | — |
| on_06 | BOOLEAN | true | — |
| file_06 | COMBO | 1 options: none.txt | |
| mode_06 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_06 | INT | 00–10000 | — |
| join_06 | STRING | , | — |
| on_07 | BOOLEAN | true | — |
| file_07 | COMBO | 1 options: none.txt | |
| mode_07 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_07 | INT | 00–10000 | — |
| join_07 | STRING | , | — |
| on_08 | BOOLEAN | true | — |
| file_08 | COMBO | 1 options: none.txt | |
| mode_08 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_08 | INT | 00–10000 | — |
| join_08 | STRING | , | — |
| on_09 | BOOLEAN | true | — |
| file_09 | COMBO | 1 options: none.txt | |
| mode_09 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_09 | INT | 00–10000 | — |
| join_09 | STRING | , | — |
| on_10 | BOOLEAN | true | — |
| file_10 | COMBO | 1 options: none.txt | |
| mode_10 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_10 | INT | 00–10000 | — |
| join_10 | STRING | , | — |
| on_11 | BOOLEAN | true | — |
| file_11 | COMBO | 1 options: none.txt | |
| mode_11 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_11 | INT | 00–10000 | — |
| join_11 | STRING | , | — |
| on_12 | BOOLEAN | true | — |
| file_12 | COMBO | 1 options: none.txt | |
| mode_12 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_12 | INT | 00–10000 | — |
| join_12 | STRING | , | — |
| on_13 | BOOLEAN | true | — |
| file_13 | COMBO | 1 options: none.txt | |
| mode_13 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_13 | INT | 00–10000 | — |
| join_13 | STRING | , | — |
| on_14 | BOOLEAN | true | — |
| file_14 | COMBO | 1 options: none.txt | |
| mode_14 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_14 | INT | 00–10000 | — |
| join_14 | STRING | , | — |
| on_15 | BOOLEAN | true | — |
| file_15 | COMBO | 1 options: none.txt | |
| mode_15 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_15 | INT | 00–10000 | — |
| join_15 | STRING | , | — |
| on_16 | BOOLEAN | true | — |
| file_16 | COMBO | 1 options: none.txt | |
| mode_16 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_16 | INT | 00–10000 | — |
| join_16 | STRING | , | — |
| on_17 | BOOLEAN | true | — |
| file_17 | COMBO | 1 options: none.txt | |
| mode_17 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_17 | INT | 00–10000 | — |
| join_17 | STRING | , | — |
| on_18 | BOOLEAN | true | — |
| file_18 | COMBO | 1 options: none.txt | |
| mode_18 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_18 | INT | 00–10000 | — |
| join_18 | STRING | , | — |
| on_19 | BOOLEAN | true | — |
| file_19 | COMBO | 1 options: none.txt | |
| mode_19 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_19 | INT | 00–10000 | — |
| join_19 | STRING | , | — |
| on_20 | BOOLEAN | true | — |
| file_20 | COMBO | 1 options: none.txt | |
| mode_20 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_20 | INT | 00–10000 | — |
| join_20 | STRING | , | — |
| on_21 | BOOLEAN | true | — |
| file_21 | COMBO | 1 options: none.txt | |
| mode_21 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_21 | INT | 00–10000 | — |
| join_21 | STRING | , | — |
| on_22 | BOOLEAN | true | — |
| file_22 | COMBO | 1 options: none.txt | |
| mode_22 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_22 | INT | 00–10000 | — |
| join_22 | STRING | , | — |
| on_23 | BOOLEAN | true | — |
| file_23 | COMBO | 1 options: none.txt | |
| mode_23 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_23 | INT | 00–10000 | — |
| join_23 | STRING | , | — |
| on_24 | BOOLEAN | true | — |
| file_24 | COMBO | 1 options: none.txt | |
| mode_24 | COMBO | 4 options: Random, Fixed, Sequential Forward, Sequential Reverse | |
| index_24 | INT | 00–10000 | — |
| join_24 | STRING | , | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| final_prompt | STRING | — |