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

πŸ“‹ Menu Option

Turn a raw value into a friendly dropdown

By StableDiffusionVNΒ·Created 2 years agoΒ·Updated 29 days agoΒ· 118
πŸ“‹ Menu Option
    • output
    β—„MenuOption_1β–Ί
    β—„Setting Option_1:parameter1 Option_2:parameter2 Option_3:parameter3 β–Ί

    This one isn't a generation node at all - it's a UI trick. You pick a friendly label from a dropdown (Option_1, Option_2, and so on) and the node hands back whatever real value you mapped that label to. Think of it as a lookup table you edit as text but use as a menu.

    Why you'd want this

    Say you've got a workflow you share with other people, or one you reuse across projects, and somewhere in it there's a fiddly parameter - a specific sampler/scheduler combo, a resolution string, a style keyword, a URL. Instead of making whoever's running it dig through raw text fields, you build a menu: "Option_1" means "the portrait setting," "Option_2" means "the landscape setting," and so on. They pick from eight clean labels; the actual value gets substituted behind the scenes. It's the same instinct as the pack's Dic Convert node - turning raw values into something you select rather than type - and it's genuinely handy once a workflow has more than one or two "presets" a user needs to flip between.

    The inputs and outputs that matter

    • Menu - an 8-way dropdown (Option_1 through Option_8). This is the only thing the person running the workflow actually touches.
    • Setting - a multiline text box where you define what each option maps to, one per line: Option_1:parameter1, Option_2:parameter2, and so on. This is where the real work happens - edit it once when you're building the workflow, then leave it alone.

    The output is a single wildcard-typed output (list) - whatever value the selected option maps to. Because it's typed *, you can wire it into pretty much anything downstream that expects a string, a number, or another compatible type; ComfyUI resolves it at connection time.

    Installing it

    In ComfyUI Manager: search SDVN_Comfy_node, install, restart. Or from the command line:

    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. Nothing to download for this one - it's a pure logic node, no models involved.

    Where people get burned

    Forgetting to edit Setting after adding an option. The dropdown always shows all eight labels regardless of whether you've defined a value for each one in the text box. Pick Option_5 with nothing defined for it in Setting and you'll get an empty or garbage output - the mapping isn't validated against the dropdown, it's just parsed as text.

    Whitespace and formatting in the mapping. Since Setting is free-form text parsed line by line on Option_N:value, a typo in the label (Option_1 :value with a stray space, or a missing colon) means that line silently fails to match. Keep the format tight and consistent with the default template.

    Only eight options, fixed. If your use case needs more than eight menu items, this node caps out - you'd need to nest another Menu Option or fall back to a different selection mechanism. For a two-level pick (main category, then a sub-choice that depends on it), the pack's separate Menu Option Extra node is the one built for that, not this one.

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

    Inputs (2)

    NameTypeDefaultDescription
    MenuCOMBOOption_18 options: Option_1, Option_2, Option_3, Option_4, Option_5, Option_6, +2
    SettingSTRING Option_1:parameter1 Option_2:parameter2 Option_3:parameter3 β€”

    Outputs (1)

    NameTypeDescription
    output*β€”