AIHub Expose String Selection
The AIHub dropdown — one option per line, and the labels are free
- STRING
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 outputs1024,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;
idunique 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
optionsafter a workflow ships, updatevalueto 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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| id | STRING | string_selection | A unique custom id for this workflow. |
| label | STRING | String Selection | This is the label that will appear in the field. |
| tooltip | STRING | An optional tooltip. | |
| options | STRING | option1 option2 option3 | A newline separated string array of values for the dropdown. |
| options_label | STRING | Option 1 Option 2 Option 3 | A newline separated string array of labels for the dropdown. Must match the number of options. |
| value | STRING | option1 | — |
| advanced | BOOLEAN | false | If set to true, this option will be hidden under advanced options for this workflow. |
| index | INT | 0 | This value is used for sorting the input fields when displaying; lower values will appear first. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |