A powerful ComfyUI custom node for dynamically loading and combining wildcard prompts. Perfect for generating diverse, randomized prompts for image generation workflows.
- Random Wildcard Selection - Automatically selects random lines from wildcard text files
- Inline Wildcard Expansion - Use
__wildcard__syntax directly in your prompts - Mad Libs Style
$prompt- Insert random wildcard content anywhere with the$promptkeyword - Subfolder Filtering - Target specific wildcard folders for more controlled randomization
- Prefix & Suffix Support - Wrap your output with custom text (e.g., LoRA triggers)
- Same File Mode - Force all random selections from a single wildcard file
- Nested Folder Control - Choose between all levels or top-level only scanning
- Seed Control - Reproducible results with seed-based randomization
cd ComfyUI/custom_nodes
git clone https://github.com/BWDrum/ComfyUI-RandomWildcardLoader.gitRestart ComfyUI after installation.
Search for "Random Wildcard Loader" in ComfyUI Manager.
| Node | Description |
|---|---|
| Random Wildcard Loader | Basic version with core functionality |
| Random Wildcard Loader (Advanced) | Full-featured version with prefix/suffix, subfolder filtering, and more |
- Create a
wildcardsfolder in your ComfyUI root directory - Add
.txtfiles with one prompt per line - Add the node to your workflow
Reference a specific wildcard file by name:
A beautiful __colors__ sunset over __landscapes__
This expands __colors__ with a random line from colors.txt and __landscapes__ from landscapes.txt.
Insert random content from any available wildcard:
The artist created a $prompt using $prompt techniques
Each $prompt is replaced with random content from a randomly selected wildcard file.
Access wildcards in subfolders:
A __styles/artistic__ painting of __subjects/animals__
| Option | Description |
|---|---|
| num_files | Number of random wildcard files to load |
| seed | Random seed for reproducible results |
| separator | Text between combined wildcards (default: , ) |
| subfolder | Limit selection to a specific subfolder |
| prefix | Text added before the output (with automatic space) |
| suffix | Text added after the output (with automatic comma) |
| include_nested | All Levels or Top Level Only folder scanning |
| same_file | Different Files or Same File for multi-selection |
Perfect for LoRA triggers:
- Prefix:
<lora:MyLora:0.8> - Suffix:
masterpiece, best quality
Output: <lora:MyLora:0.8> cyberpunk city, neon lights, masterpiece, best quality
ComfyUI/
├── wildcards/
│ ├── colors.txt
│ ├── styles.txt
│ ├── subjects/
│ │ ├── animals.txt
│ │ └── people.txt
│ └── artistic/
│ ├── movements.txt
│ └── techniques.txt
└── custom_nodes/
└── ComfyUI-RandomWildcardLoader/
Simple text files with one option per line:
colors.txt
vibrant red
deep blue
golden yellow
emerald green
soft pink
styles.txt
photorealistic
oil painting
watercolor
digital art
anime style
The node displays:
- Loaded Contents - The final combined output text
- Loaded Wildcards - Which wildcards were used (e.g.,
styles/__artistic__,__colors__)
- ComfyUI (latest version recommended)
- No additional dependencies required
MIT License - Feel free to use, modify, and distribute.
Pull requests and issues are welcome! Feel free to suggest new features or report bugs.
Made with care for the ComfyUI community
