Prompt Preset Selector (Wildcard)
Wildcard presets from plain text files, with a keyword filter bolted on
- text
- preset_list
- selected_info
If you batch generations, you've hit the wall this node exists to smash: hand-editing a prompt between every queue is soul-crushing, and a single hardcoded prompt means 20 nearly identical images. This is a text node that picks a prompt line out of an external .txt, .yaml, or .yml file - think camera angles, clothing, lighting setups, an anime character database - and pushes it into your CLIP Text Encode. It's the wildcard variant of the pack's basic Preset Selector, and the extra enable_wildcard flag is the whole reason to pick it over the plain version.
The wildcard angle is what you actually want. {A|B|C} choice syntax is the old A1111 bracket trick - {red|blue|green} dress picks one per run - and Impact Pack's __filename__ file reference made the same idea standard in ComfyUI. This node speaks both, plus Impact Pack's {__key__|__key__} YAML-key selection. So a preset like __colors__ {dress|suit|jacket} expands to "red dress", "blue suit", and so on, randomly or sequentially depending on your selection mode. That's batch variety without touching the prompt again.
How it works
Preset files load from three places, in priority order: whatever you type in absolute_path (this wins), the node's own presets/ folder, then Impact Pack's wildcards/ folder if it's installed - so it can reuse wildcard libraries you already own. YAML is flattened into one list: nested dicts get their key path prepended, so camera_angles.close_up becomes camera_angles:close_up: front view, low-angle shot..., and you can search by those keys.
The interesting inputs, the ones you'll actually touch:
selection_mode- Manual (usespreset_index), Sequential, Sequential (continue), or Random (seeded, so same seed = same pick).keyword+keyword_mode- the filter.front close-up -widein AND mode means "must have front AND close-up, never wide". Quotes make phrases, a minus excludes, and a:suffix searches YAML keys. It's powerful and genuinely fiddly - keep the README open the first week.enable_wildcard- wildcard expansion on/off. Leave it on; it does nothing if there's no wildcard syntax.
Outputs: text (the selected, expanded prompt - that's the one that feeds your text encoder), preset_list (a numbered list of everything that matched your filter, handy for finding the right index), and selected_info (debug text telling you which preset won and how many got filtered out). The last two are a nice touch most preset nodes skip.
Install
ComfyUI Manager, search "Prompt Preset Selector", or:
cd ComfyUI/custom_nodes
git clone https://github.com/shin131002/ComfyUI-Prompt-Preset-Selector
Then restart ComfyUI. For YAML support it wants pip install pyyaml, but that ships with practically every ComfyUI install - the node just warns if it's missing. No model downloads, no heavy dependencies, and editing preset files doesn't even need a restart (they reload on execution, which the node makes a point of).
Where people trip
absolute_pathsilently overrides the dropdown, and only.txt/.yaml/.ymlextensions are accepted. On Windows use forward slashes even in an absolute path.- Filter doing nothing?
keyword_modeisOFFby default. Flip it to AND or OR. - Exclusions quietly break if you type
- wide; there can't be a space after the minus. - Searching a keyword like
heroeswill also match the wildcard choice line{__heroes__|__villains__}. The fix is searchingheroes:instead, which only hits real key hierarchies. {__key__|__key__}references keys within the currently selected YAML file - it doesn't reach into other files. That catches everyone once.
One honest caveat: this is a solo, explicitly unsupported project - the README says bug reports may go unanswered and it's MIT, so forking is the fallback. It's not the pack for prompt curation at enterprise scale, but for a personal character or style library that you edit in a text editor, it's exactly right.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| preset_file | COMBO | 1 options: (No preset files found) | |
| absolute_path | STRING | — | |
| keyword | STRING | — | |
| keyword_mode | COMBO | OFF | 3 options: OFF, AND, OR |
| selection_mode | COMBO | Manual | 4 options: Manual, Sequential, Sequential (continue), Random |
| preset_index | INT | 00–9999 | — |
| seed | INT | 00–18446744073709550000 | — |
| enable_wildcard | BOOLEAN | true | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| preset_list | STRING | — |
| selected_info | STRING | — |