Nodes/AUN ComfyUI Nodes/Preset Manager
ComfyUI Node

Preset Manager

One node that switches a whole row of settings by keyword — Preset Manager

By loz2754·Created 8 months ago·Updated a day ago· 5
Preset Manager
    • selected_values
    • matched_keyword
    • matched_index
    • value_1
    • value_2
    • value_3
    • value_4
    • value_5
    • value_6
    • value_7
    • value_8
    • value_9
    • value_10
    • value_11
    • value_12
    node_identifier
    manual_preset1
    match_keywordsYes
    visible_rows5
    case_sensitivefalse
    reference_phrase
    preset_data

    Settings never travel alone in ComfyUI. A "cinematic" look is a sampler, a scheduler, a steps count, a CFG, maybe a specific seed behavior - a bundle of widget values scattered across half a dozen nodes. Preset Manager (AUNPresetManager) is the AUN pack's answer: it scans one target node's widgets, lets you save up to 20 keyword-triggered rows of values, and at runtime picks a row and hands it out as a JSON blob. You don't click through a dozen widgets to change the mood - you type a word, or let one arrive down a wire.

    It's the "brain" half of a two-node preset system. Preset Manager decides which row wins; its companion Apply Preset To Node (AUNApplyPresetToNode) actually writes those values into the target's inputs at queue time. If that sounds like overkill for one node, it kind of is - the split is what makes it powerful. The Manager is a pure "select a row" device you can read in any workflow, and the Apply node is the thing that makes the selection stick even on cached re-runs.

    How it works

    Hit the Setup button and a dialog scans the target node's widgets live from the graph. You build rows - each row has a keyword and one value per widget - and the dialog stores the whole thing as JSON in a hidden preset_data widget. That means your presets travel inside the workflow file; save the workflow and the rows come with it.

    At execution time the node matches keywords against the reference_phrase input. Matching is substring-based and case-insensitive by default, each row's keyword can be a comma-separated list where any one entry activates the row, and the first matching row wins (top to bottom). No match, or match_keywords set to No, and it falls back to the manual_preset row. The chosen row's values go out the selected_values output as JSON, ready for Apply Preset To Node.

    The inputs that matter

    • node_identifier - the numeric ID or title of the target node. This is what the Setup dialog scans, so point it at the node whose widgets you want to control.
    • reference_phrase - the text to scan for keywords. Wire this to a prompt or any string; this is the clever part, because it means the active preset can be driven by the same text that drives generation.
    • match_keywords (Yes/No) - whether keywords can override the manual pick. No forces the manual row.
    • manual_preset (1–20) - which row is the manual fallback. Clamped to visible_rows.
    • visible_rows (1–20, default 5) - how many rows are actually active.
    • case_sensitive - off by default; keywords match as substrings either way.

    The preset_data field is internal - the Setup dialog owns it, leave it alone.

    Outputs: selected_values (the row's JSON), matched_keyword and matched_index (useful for filenames or Show Any), plus value_1 through value_12 - ANY-typed slots labelled with the widget names, for wiring values straight into a target node's converted inputs or into filename fields like AUNSaveImageV2's. That last part is the underrated trick: the same values that drive a KSampler can also spell out the filename.

    Common issues

    The classic failure is forgetting the second half: Preset Manager only selects. Wire selected_values into an Apply Preset To Node's preset_values input, or nothing changes on the target. If no keyword matches and you expected one, check the matched_keyword output - empty means the fallback row ran. And if the target node's widgets change, hit Setup again; the stored rows are a snapshot of what was scanned.

    Installation

    This node ships with the full AUN pack, so install the whole thing:

    cd ComfyUI/custom_nodes
    git clone https://github.com/loz2754/AUN-ComfyUI-Nodes
    

    Restart ComfyUI, or just search "AUN ComfyUI Nodes" in ComfyUI-Manager. The pack's dependencies (piexif, opencv-python-headless, imageio-ffmpeg, requests) are declared in requirements.txt and Manager handles them; manual cloners who hit ModuleNotFoundError: piexif or cv2 can run pip install -r custom_nodes/AUN-ComfyUI-Nodes/requirements.txt. For these two nodes specifically you don't need ffmpeg or OpenCV - but the pack installs as one unit, so they come anyway.

    CategoryAUN Nodes/Utility

    Inputs (7)

    NameTypeDefaultDescription
    node_identifierSTRINGNumeric ID or Title of the target node. Used by the Setup dialog to discover the target's widgets.
    manual_presetCOMBO1Which preset row (1-20) to use as the active bundle. Clamped to visible_rows. With match_keywords=No, this is always used. With match_keywords=Yes, keywords can override it when they match.
    match_keywordsCOMBOYesYes: keywords are matched against reference_phrase; the first matching row wins, falling back to manual_preset. No: keywords are ignored; manual_preset is always used.
    visible_rowsoptINT51–20How many preset rows are active (1-20).
    case_sensitiveoptBOOLEANfalseIf enabled, keyword matching is case-sensitive.
    reference_phraseoptSTRINGText to scan for keywords. Keywords are matched as substrings.
    preset_dataoptSTRINGInternal: JSON preset rows edited by the Setup dialog. Hidden from the UI.

    Outputs (15)

    NameTypeDescription
    selected_valuesSTRING
    matched_keywordSTRING
    matched_indexINT
    value_1*
    value_2*
    value_3*
    value_4*
    value_5*
    value_6*
    value_7*
    value_8*
    value_9*
    value_10*
    value_11*
    value_12*