Any Enum Switch 10X (Soze)
A ten-case switch that keys on a string and spits out anything
- default_value
- any_value_1
- any_value_2
- any_value_3
- any_value_4
- any_value_5
- any_value_6
- any_value_7
- any_value_8
- any_value_9
- any_value_10
- matched_value
- matched_index
- matched
- status
ComfyUI's switch nodes are usually either type-locked (this CONDITIONING mux only takes CONDITIONING) or so generic they get impossible to read. Any Enum Switch 10X takes a different approach: it's a plain string lookup table. Give it an enum_value, and it returns whichever of ten any-typed values matches the case label. One input drives the whole routing decision.
The mental model is a switch statement, not a mux. You decide the key, the node does the matching, and what it hands back can be a string, a number, a model, a conditioning - anything. That's the whole trick, and it's why this node shows up in batch workflows where a CSV column or a text input selects behavior per run.
How it works
The node compares enum_value against ten case labels (compare_text_1…compare_text_10). On the first match it returns the corresponding any_value_N. No match? You get default_value. The matching defaults matter:
- Case-insensitive by default (
A==a), togglecase_sensitiveif you care. - Whitespace is trimmed on both sides by default, so
" happy "matches"happy". Togglestrip_whitespaceoff for exact matching. - Blank case labels are skipped, so an unconnected
compare_text_Nwidget can't accidentally match a blankenum_value. This saves more confusion than you'd think. - First match wins - case 1 beats case 3 if both labels match.
Outputs: matched_value (the routed value), matched_index (1-based position, 0 when nothing matched), matched (a boolean you can feed into a logic check), and status (which tells you what matched, or that you got the default).
Where it earns its keep
Pair it with a CSV reader - pick a random style, subject or sampler name per run, and let this node route a prompt block or an enum value downstream. Or use it as a named preset switcher: enum_value says "cinematic", the node returns the full prompt/settings blob you stashed in any_value_3. Because the inputs are wildcards, the same node can route a MODEL, a string, or an int depending on what you wire in - you're not committing to a type at graph-build time.
Where people get burned: feeding in an enum_value that's actually a number while the labels are strings, or expecting a failed match to error out. It won't - it silently returns default_value with matched_index == 0. If you're relying on a match, check the boolean output before continuing downstream, or leave default_value empty and handle the blank.
Installing it
Same as any node in the Soze pack:
cd ComfyUI/custom_nodes
git clone https://github.com/SozeInc/ComfyUI_Soze.git
pip install -r ComfyUI_Soze/requirements.txt
Or search "ComfyUI_Soze" in ComfyUI Manager and restart. It's a pure-Python node - no API key, no model files, nothing extra to configure. Look for "Any Enum Switch 10X (Soze)" under the soze category in the node menu.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| enum_value | STRING | The value to match against each compare_text_N. | |
| default_valueopt | * | Returned when no compare_text_N matches. | |
| case_sensitiveopt | BOOLEAN | false | If True, 'A' != 'a'. |
| strip_whitespaceopt | BOOLEAN | true | If True, surrounding whitespace is ignored on both sides. |
| compare_text_1opt | STRING | Case 1 label. Blank means: skip this case. | |
| any_value_1opt | * | Value returned when enum_value matches compare_text_1. | |
| compare_text_2opt | STRING | Case 2 label. Blank means: skip this case. | |
| any_value_2opt | * | Value returned when enum_value matches compare_text_2. | |
| compare_text_3opt | STRING | Case 3 label. Blank means: skip this case. | |
| any_value_3opt | * | Value returned when enum_value matches compare_text_3. | |
| compare_text_4opt | STRING | Case 4 label. Blank means: skip this case. | |
| any_value_4opt | * | Value returned when enum_value matches compare_text_4. | |
| compare_text_5opt | STRING | Case 5 label. Blank means: skip this case. | |
| any_value_5opt | * | Value returned when enum_value matches compare_text_5. | |
| compare_text_6opt | STRING | Case 6 label. Blank means: skip this case. | |
| any_value_6opt | * | Value returned when enum_value matches compare_text_6. | |
| compare_text_7opt | STRING | Case 7 label. Blank means: skip this case. | |
| any_value_7opt | * | Value returned when enum_value matches compare_text_7. | |
| compare_text_8opt | STRING | Case 8 label. Blank means: skip this case. | |
| any_value_8opt | * | Value returned when enum_value matches compare_text_8. | |
| compare_text_9opt | STRING | Case 9 label. Blank means: skip this case. | |
| any_value_9opt | * | Value returned when enum_value matches compare_text_9. | |
| compare_text_10opt | STRING | Case 10 label. Blank means: skip this case. | |
| any_value_10opt | * | Value returned when enum_value matches compare_text_10. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| matched_value | * | — |
| matched_index | INT | — |
| matched | BOOLEAN | — |
| status | STRING | — |