Random Wildcard Loader (Advanced)
The wildcard node with useful knobs — LoRA triggers, subfolder pins, same-file mode
- combined_text
The basic Random Wildcard Loader is great until you want control. That's the job of its sibling, Random Wildcard Loader (Advanced): everything the basic node does - __colors__-style expansion, $prompt Mad Libs fills, seed-based reproducibility - plus the knobs that make wildcards usable in real workflows. If you're generating a themed batch, want a LoRA trigger on every output, or need the random picks to stay inside one category, this is the one to reach for.
The mechanics underneath are identical, so read the basic node article for the full picture. Both read .txt files from ComfyUI/wildcards/ (one option per line, subfolders fine, folder auto-created on first run), expand __wildcard__ and $prompt placeholders in the prompt field, and seed Python's random so the same seed always reproduces the same draw. What the Advanced node adds is control over how the result is shaped.
The inputs that actually do things
prompt- your template, exactly like the basic node.num_files- how many random wildcard lines to append (0–100). Crank this up and you're essentially fuzzing the prompt.seed- the draw control. ComfyUI only re-runs this node when the seed changes, so bump it (or togglerefresh) to roll again.separator- text between the expanded prompt and each appended wildcard. Defaults to,, which is right for tag-based models. The basic node is stuck with newlines; this one isn't.subfolder- restrict the random pool to one folder, e.g.styles. You type it by hand, so match folder names exactly.prefixandsuffix- wrap the entire combined output.prefixgets a trailing space,suffixgets a leading,. The canonical use is LoRA triggers: prefix<lora:my_style:0.8>, suffixmasterpiece, best quality, and every randomized prompt ships with both.include_nested-All Levelsscans subfolders;Top Level Onlysticks to a single directory. Useful when yoursubfoldercontains nested sub-subfolders you don't want polluting the pool.same_file-Different Filespicksnum_filesdistinct files;Same Filepicks one file and drawsnum_fileslines from it.
One behavior worth knowing: Same File draws with replacement, so the same line can show up twice in a single output. If that bugs you, that's where it comes from - it's a dice roll, not a bug.
loaded_contents and loaded_wildcards are readouts (updated by the node's JS), and the single output, combined_text, is a STRING that wires into a CLIP Text Encode or anywhere else a prompt text goes.
Install
Same as the basic node - ComfyUI Manager, search "Random Wildcard Loader", or:
cd ComfyUI/custom_nodes
git clone https://github.com/BWDrum/ComfyUI-RandomWildcardLoader.git
Restart ComfyUI. No dependencies, no models, no pip installs.
Gotchas
The silent-failure rules carry over from the basic node: an unresolvable __wildcard__ or a $prompt with an empty pool passes through as literal text, so check the loaded_wildcards readout if your images start spelling out __colors__. Prefix and suffix only apply when there's actual output - empty prompt plus nothing loaded means the whole thing, prefix included, comes back empty. And if subfolder points at a folder that doesn't exist, the pool is empty and your $prompt placeholders survive all the way to the text encoder. Fix the folder name, not the prompt.
For a tiny single-author pack, this is surprisingly complete. The author's stated use case - prompt adherence testing, running one skeleton across randomized fills to see what a model actually follows - is genuinely fun with num_files cranked up. Just keep your wildcard files tidy, because the node trusts them completely.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| num_files | INT | 10–100 | — |
| seed | INT | 00–18446744073709550000 | — |
| prompt | STRING | — | |
| loaded_contents | STRING | — | |
| loaded_wildcards | STRING | — | |
| separator | STRING | , | — |
| subfolder | STRING | — | |
| prefix | STRING | — | |
| suffix | STRING | — | |
| include_nested | COMBO | All Levels | 2 options: All Levels, Top Level Only |
| same_file | COMBO | Different Files | 2 options: Different Files, Same File |
| refresh | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| combined_text | STRING | — |