Nodes/ComfyUI-aihub-workflow-exposer/AIHub Expose String Selection
ComfyUI Node

AIHub Expose String Selection

The AIHub dropdown — one option per line, and the labels are free

By otavanopisto·Created about a year ago·Updated 22 days ago· 7
AIHub Expose String Selection
    • STRING
    idstring_selection
    labelString Selection
    tooltip
    optionsoption1 option2 option3
    options_labelOption 1 Option 2 Option 3
    valueoption1
    advancedfalse
    index0

    When you want the person on the other end of an AIHub workflow to pick from a fixed list instead of typing freeform, this is the node: AIHubExposeStringSelection. It's the dropdown of the otavanopisto ComfyUI-aihub-workflow-exposer pack, and the mental model is dead simple - you give it a newline-separated list of options, the client renders a dropdown, and the node outputs whichever string the user chose.

    The part people miss is the two-list design, which is actually the feature that makes this node pleasant to use. You're not limited to one list.

    The inputs that matter

    • options - the actual values, one per line (default option1\noption2\noption3). These are what the node outputs. Keep them machine-friendly: ids, filenames, enum-ish values.
    • options_label - the pretty versions the user sees, one per line. The source requires the count to match options. So you can show "Portrait 1024×1024" while the node outputs 1024,1024. This is the workflow you get for free in a client UI that otherwise has zero styling knobs.
    • value - the currently selected option; must be present in the options list or the source raises ValueError ("The value given is not in the list of options"). That's a real failure mode when you copy-paste a workflow and the default got out of sync with a list you edited.
    • id / label / tooltip / advanced / index - standard expose fields; id unique per workflow.

    Output is a single STRING, and the author's README shows the natural next hop: pair it with the pack's conversion utils. A resolution selector (landscape / portrait) feeding AIHubUtilsStrToVector to get 1920,1080 or 1080,1920, or feeding AIHubUtilsStrToFloat for a numeric setting. Because the output is just a string, it also drops straight into any text input you've got.

    Gotchas worth writing down

    • Options are split on newlines and stripped, so blank lines are ignored - but a trailing blank line will still trip the "value not in list" check if it appears inside an option you typed. Keep the list clean.
    • If you change options after a workflow ships, update value to match. That single mismatch is the most common way this node errors.
    • No comma-separated shortcut: it's one option per line, always.

    Install is the pack standard - no requirements, nothing to download:

    cd ComfyUI/custom_nodes
    git clone https://github.com/otavanopisto/ComfyUI-aihub-workflow-exposer
    

    Restart ComfyUI. Honest framing: this node is genuinely the friendliest thing in the pack - it's the one place a non-technical user gets a real, safe, impossible-to-typo control. If you're building an AIHub workflow for an editor, string selections should be your default "let the user pick" control, not free text.

    Categoryaihub/expose

    Inputs (8)

    NameTypeDefaultDescription
    idSTRINGstring_selectionA unique custom id for this workflow.
    labelSTRINGString SelectionThis is the label that will appear in the field.
    tooltipSTRINGAn optional tooltip.
    optionsSTRINGoption1 option2 option3A newline separated string array of values for the dropdown.
    options_labelSTRINGOption 1 Option 2 Option 3A newline separated string array of labels for the dropdown. Must match the number of options.
    valueSTRINGoption1
    advancedBOOLEANfalseIf set to true, this option will be hidden under advanced options for this workflow.
    indexINT0This value is used for sorting the input fields when displaying; lower values will appear first.

    Outputs (1)

    NameTypeDescription
    STRINGSTRING