Nodes/SDVN_Comfy_node/πŸ“‹ Menu Option Extra
ComfyUI Node

πŸ“‹ Menu Option Extra

A cascading dropdown, main category then sub-choice

By StableDiffusionVNΒ·Created 2 years agoΒ·Updated about a month agoΒ· 118
πŸ“‹ Menu Option Extra
    • menu
    • sub_menu
    β—„MenuOption_1β–Ί
    β—„Sub_MenuSub_1β–Ί
    β—„Setting Option_1: sub_a, sub_b, sub_c Option_2: sub_d, sub_e, sub_f Option_3: sub_g, sub_h β–Ί

    This is the two-level version of the pack's plain Menu Option node. Instead of one dropdown mapping to one value, you get a main category picker and a sub-choice picker underneath it, where the sub-choices you can pick from actually change depending on which main option you selected. It's the closest thing ComfyUI has to a cascading dropdown, built out of plain text.

    Why you'd want this

    The plain Menu Option node is fine for a flat list of presets. But some choices are naturally hierarchical - "style: portrait" has different valid sub-options than "style: landscape," and you don't want a flat menu of twenty items where most of them don't apply to whatever you just picked. Menu Option Extra handles exactly that shape: pick your main option, and the sub-menu narrows to the choices that actually belong to it. Useful for workflows you're building for other people to run - a curated menu is a lot friendlier than a wall of raw parameters, and this is the version of that idea for anything genuinely two-tiered.

    The inputs and outputs that matter

    • Menu - the main-category dropdown, Option_1 through Option_8.
    • Sub_Menu - the sub-choice dropdown, Sub_1 through Sub_5.
    • Setting - a multiline text box mapping each main option to its own comma-separated list of sub-values, one line per option: Option_1: sub_a, sub_b, sub_c, Option_2: sub_d, sub_e, sub_f, and so on. The position of Sub_Menu (1st, 2nd, 3rd…) picks which comma-separated entry gets returned for the currently selected Menu option.

    Two outputs, both wildcard-typed lists: menu (the resolved value for the main selection) and sub_menu (the resolved value for the sub-selection). Wire each into whatever downstream input expects that value - same wildcard-resolves-at-connection behavior as the rest of the pack's *-typed utility nodes.

    Installing it

    In ComfyUI Manager: search SDVN_Comfy_node, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StableDiffusionVN/SDVN_Comfy_node
    

    Then pip install -r custom_nodes/SDVN_Comfy_node/requirements.txt from your ComfyUI root, and restart. No models, no dependencies beyond the base pack - this is pure logic.

    Where people get burned

    Mismatched counts between Sub_Menu position and the Setting list. Sub_Menu is a fixed 5-way dropdown (Sub_1–Sub_5), but nothing stops you from writing fewer than 5 comma-separated values on a given Option_N line. Pick Sub_5 when that line only lists three sub-values and you'll get an out-of-range result. Keep every option line the same length, or at least as long as the highest Sub_N you actually intend to use.

    Editing Setting and forgetting which position means what. Because the sub-values are positional (first item, second item, third…) rather than labeled, it's easy to reorder a line while editing and quietly break which Sub_N maps to which meaning. Comment your intent above the text box, or keep a plain-text copy of the mapping somewhere you can check against.

    Same 8Γ—5 ceiling as the base node. If your hierarchy needs more branches than that, you're out of room here - this node is sized for menu-building, not for encoding a large lookup table.

    CategoryπŸ“‚ SDVN/πŸ’‘ Creative

    Inputs (3)

    NameTypeDefaultDescription
    MenuCOMBOOption_18 options: Option_1, Option_2, Option_3, Option_4, Option_5, Option_6, +2
    Sub_MenuCOMBOSub_15 options: Sub_1, Sub_2, Sub_3, Sub_4, Sub_5
    SettingSTRING Option_1: sub_a, sub_b, sub_c Option_2: sub_d, sub_e, sub_f Option_3: sub_g, sub_h β€”

    Outputs (2)

    NameTypeDescription
    menu*β€”
    sub_menu*β€”