Nodes/ComfyUI-Prompt-Preset-Selector/Prompt Preset Selector (Multi-File, Wildcard)
ComfyUI Node

Prompt Preset Selector (Multi-File, Wildcard)

Three preset files at once, without a merge step

By shin131002·Created 8 months ago·Updated 2 days ago· 2
Prompt Preset Selector (Multi-File, Wildcard)
    • text
    • preset_list
    • selected_info
    enabled1true
    preset_file1
    absolute_path1
    enabled2true
    preset_file2
    absolute_path2
    enabled3true
    preset_file3
    absolute_path3
    keyword
    keyword_modeOFF
    selection_modeManual
    preset_index0
    seed0
    enable_wildcardtrue

    Here's the scenario this node exists for: your camera angles live in a plain .txt, your lighting setups are in a YAML file with a nested structure, and your character list is a third YAML in a completely different format. You want to pull from all of them at once, but merging three differently-shaped files by hand is exactly the kind of busywork you installed ComfyUI to avoid. The Multi-File version of Prompt Preset Selector skips the merge: up to three preset files, each with its own on/off toggle, loaded into one combined pool.

    It's a text-plumbing node from the same pack as the single-file and Folder selectors - no models, no keys, nothing heavy. It's the middle child of the family, and for most people it's actually the sweet spot: all the power of the Folder node without having to babysit a directory tree.

    How it works

    Three independent file slots, each with three fields: enabled{n} (turn it off without clearing its settings), preset_file{n} (a dropdown), and absolute_path{n} (which wins over that slot's dropdown if you fill it in). Every line from every active slot gets prefixed with its file name:

    colors.txt: red
    colors.txt: blue
    camera_angles.yaml: camera_angles:close_up: front view, low-angle shot
    

    The combined list is numbered slot 1 first, then 2, then 3, in each file's original order - so preset_index counts across the whole pool. The wildcard support is full, and it's smarter than the single-file version: {__key__|__key__} searches keys across all loaded files, so a key defined in heroes.yaml can reference one in sidekicks.yaml. If the same top-level key exists in two files, the later-loaded file wins.

    The inputs that matter

    • enabled1 / enabled2 / enabled3 - flip a file off to A/B test combinations without retyping paths.
    • preset_file{n} and absolute_path{n} - the source for each slot; the absolute path overrides the dropdown.
    • keyword + keyword_mode - filtering over the combined list. Here's the trick the README highlights: since lines carry file-name prefixes, searching colors.txt: narrows the pool to that one file, which keeps indices stable.
    • selection_mode, preset_index, seed - the usual selection machinery, identical to the rest of the pack.
    • enable_wildcard - true unless you want wildcard syntax emitted literally.

    Outputs are the pack standard: text (wire to your prompt), preset_list (numbered, for finding indices), and selected_info (what was selected and why). If every slot is disabled or nothing survives the filter, text is an empty string - not an error - and selected_info tells you what happened.

    Install

    ComfyUI Manager search "Prompt Preset Selector", or clone it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/shin131002/ComfyUI-Prompt-Preset-Selector.git
    pip install pyyaml   # optional, only for YAML files; usually already present
    

    Restart ComfyUI and you're done. No models, no extra runtimes.

    Where people get burned

    Two things, both easy to hit:

    1. Disabling a slot renumbers everything. Turning off enabled2 removes that file's lines from the pool entirely, which shifts the indices of everything after it. If you rely on a fixed preset_index, scope with a keyword prefix like colors.txt: so the numbering stops moving.
    2. File-name prefixes can collide. The prefix is just the file name, not the path - two files named colors.txt in different folders share a prefix, so you can't scope between them. (The Folder node in this pack fixes that with relative paths; here, rename the files.)

    Also worth knowing: this pack ships with a blunt "no individual support" disclaimer - it's MIT, so the support model is "fork it." Fine for a utility this small, but don't file a bug expecting a fix on a schedule.

    Categorytext

    Inputs (15)

    NameTypeDefaultDescription
    enabled1BOOLEANtrue
    preset_file1COMBO1 options: (None)
    absolute_path1STRING
    enabled2BOOLEANtrue
    preset_file2COMBO1 options: (None)
    absolute_path2STRING
    enabled3BOOLEANtrue
    preset_file3COMBO1 options: (None)
    absolute_path3STRING
    keywordSTRING
    keyword_modeCOMBOOFF3 options: OFF, AND, OR
    selection_modeCOMBOManual4 options: Manual, Sequential, Sequential (continue), Random
    preset_indexINT00–9999
    seedINT00–18446744073709550000
    enable_wildcardBOOLEANtrue

    Outputs (3)

    NameTypeDescription
    textSTRING
    preset_listSTRING
    selected_infoSTRING