List Logic (VixUI)
A dropdown that routes one of six execution paths, lazily
- input_first
- input_second
- input_third
- input_fourth
- input_fifth
- input_sixth
- output_to
VixUiListLogic is the multi-way version of the checkbox switch. Where VixUiCheckboxLogic picks between two branches, this picks between up to six. A dropdown defines the options, and whichever one is selected routes the matching input_first through input_sixth out the single output_to port - again lazily, so only the selected branch's subgraph actually runs.
That makes it the natural control for "quality presets" in a Visionatrix flow. One dropdown offering Fast / Balanced / Quality, each wired to its own sampler settings or upscale path, and the user just picks. Up to six modes, and only the chosen one costs you VRAM or time.
Inputs that matter
- default_value (STRING) - the selected option, which determines which input gets routed. This is also the dropdown's default in the Visionatrix UI.
- possible_values (STRING, multiline, default
"[]") - the option list as JSON, e.g.["Fast", "Balanced", "Quality"]. Position in the list maps 1:1 to the inputs: index 0 →input_first, index 1 →input_second, and so on. - input_first … input_sixth (*) - the six branches. Only the one matching the selected option is evaluated.
- display_name (default
"Display Name"), optional, advanced, order (default99), custom_id - the usual VixUI metadata.
hidden is the optional input.
Outputs
output_to (*) - the value of whichever branch the selection points at. Any type.
How it works
The node parses possible_values as JSON, finds the index of default_value in the list, and routes that index's input to the output - index out of range raises a RuntimeError("Workflow logic error"). check_lazy_status tells ComfyUI to compute only the routed branch. The mapping is purely positional, so the order of your JSON list and the order of your inputs must agree.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Visionatrix/ComfyUI-Visionatrix
Restart ComfyUI, or install ComfyUI-Visionatrix via ComfyUI Manager. No model downloads; deps are torch, pillow, numpy.
Gotchas
Three traps, all mechanical. First, positional mapping: change the order of possible_values and you silently rewire everything - the list order is the wiring. Second, JSON strictness: json.loads fails on trailing commas or single quotes, and if default_value isn't in the list, list.index() raises and the whole flow dies with a logic error. Third, six inputs max: need a seventh mode and you're building a second node. When it works, though, it's the cleanest "one control, many modes" pattern in the pack - a dropdown plus six lazy branches beats a tangle of boolean switches every time.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| default_value | STRING | — | |
| possible_values | STRING | [] | — |
| display_name | STRING | Display Name | — |
| optional | BOOLEAN | true | — |
| advanced | BOOLEAN | true | — |
| order | INT | 99 | — |
| custom_id | STRING | — | |
| input_firstopt | * | — | |
| input_secondopt | * | — | |
| input_thirdopt | * | — | |
| input_fourthopt | * | — | |
| input_fifthopt | * | — | |
| input_sixthopt | * | — | |
| hiddenopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output_to | * | — |