Enum Combo
The Dropdown That Turns '0 = TXT2IMG' into a Real Choice
- value
Every dynamic workflow in ComfyUI eventually hits the same ugly pattern. You're routing a graph with a switch node - Impact Pack's Switch (Any), an rgthree lazy switch, a Set/Get variable - and the switch picks its branch by a bare integer. So you write 0 = TXT2IMG, 1 = IMG2IMG, 2 = INPAINT in a sticky note and spend the next month squinting at it. Enum Combo is the small fix for that: a real dropdown that outputs the integer.
It does exactly one thing, and it's honest about it. You feed it a list of names, pick one from a dropdown, and it hands you the matching INT. That INT is what you wire into a switch's index input or a lazy input that wants a number. The name isn't a lie - there's no API, no model download, no Python dependencies. It's a three-ounce utility node from a solo dev, and it earns its place.
How it works
The list of options lives in a STRING input called enum_definition, one member per line:
TXT2IMG
IMG2IMG
INPAINT
Values are zero-based by default, so TXT2IMG = 0, IMG2IMG = 1, INPAINT = 2. The clever part is the frontend. This pack ships a JavaScript extension that reads the definition, rebuilds the dropdown to match, and keeps it in sync - it refreshes when the definition link changes, when the connected source widget changes, and right before the dropdown opens. The dropdown even steps through values if you click its left or right edge. That "works live, not after a rerun" feel is why people reach for it over a hand-rolled combo.
The inputs that matter
There are only two, and you'll touch both:
enum_definition(STRING) - socket-only. The compact node hides the text widget, so the list must come from a wired STRING node. One name per line.choice- the dropdown you click. It fills itself fromenum_definition.
The single output is value (INT): the selected member's integer. That's the wire you run to your switch.
Install
ComfyUI Manager is the easy path - search "ComfyUI-EnumCombo". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/SparknightLLC/ComfyUI-EnumCombo
Then restart ComfyUI, not just a reload - the pack is a frontend extension, and the JS needs a fresh load. No models, no extra pip installs; requirements.txt is empty by design.
Where people get burned
The dropdown sitting on OPTION_A / OPTION_B is the tell that nothing is wired. Those are the fallback values; without a link, the node has no definition. Connect a STRING node carrying your list and it should fill in on its own.
Second gotcha: this node is always strict. If you edit the definition so the choice you had selected no longer exists, execution errors out and the message helpfully lists the available options. That's a feature when it catches a stale workflow, but if you want a definition you can edit inside the node - plus a toggle for that strictness - the sibling node is Enum Combo Advanced. This one is the lean version: definition comes in on a wire, one INT comes out.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| choice | COMBO | OPTION_A | The enum member to select. The dropdown updates from enum_definition. |
| enum_definition | STRING | OPTION_A OPTION_B | Connect a STRING node containing one enum member per line. The compact node refreshes its choice dropdown when this link changes and before the choice dropdown opens. Use Enum Combo Advanced if you want to edit the definition directly inside the enum node. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | INT | INT: The selected enum member's integer value. |