PVL Switch x5
The little lazy switch for when five options is plenty
- input_default
- input_1
- input_2
- input_3
- input_4
- input_5
- output
PVL_Switch_x5 is the sensible sibling of the pack's fifteen-way switch: same routing logic, but five cases instead of fifteen, which means a quarter of the graph clutter. For most real workflows it's the one you actually want. Nobody genuinely juggles fifteen branches in a graph they have to maintain; five is where the "pick which pipeline runs" idea stops being a showpiece and starts being everyday.
How it works
It's a string-keyed, lazily-evaluated router. You type labels into case_1 through case_5, connect values into input_1 through input_5, and switch_condition decides which one comes out of output.
The lazy part is the reason to reach for it over a naive switch. Each input is marked lazy, and the node's check_lazy_status only asks ComfyUI to evaluate the single input whose case matched. The other four never execute. That's what makes it legal to route wildly different types through one node - feed a MODEL into one input, a CLIP into another, a plain STRING into a third, and switching between them works because the branches you didn't pick are never validated or run. If you're A/B-testing a checkpoint swap or comparing prompt strategies, that's exactly the behavior you want.
Inputs and output
The three that matter:
switch_condition- the selector. Compared to the case labels as an exact, case-sensitive string match. Can be typed or wired in from a text node.case_1…case_5- the labels. Plain string widgets, typed by you, not wired.input_default- the fallback used whenswitch_conditionmatches nothing.
Output is a single output with wildcard type, so it drops into a model loader, a conditioning path, a prompt - wherever you need the routed value.
The one gotcha that matters
No match, no input_default, and you get None out - which then errors the next node downstream. Wire input_default every time. It's the whole difference between "safe fallback" and "landmine you'll rediscover at 2am."
Also remember matching is exact: case-sensitive, no trimming. "flux" vs "Flux" is a miss, and everything silently lands on the default. If that happens, check your labels before you check the node.
Install
Same pack as the rest of the PVL utilities: pvlprk/comfyui-pvl-api-nodes, listed in ComfyUI Manager as ComfyUI Assistant Node (a title that only describes the OpenAI-assistant node it's named after - the repo actually ships dozens of API wrappers and utility nodes). Clone it if you're not on Manager:
cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes
Restart ComfyUI, and it's ready. No models to download, and this node itself only needs torch - the pack's heavy requirements.txt (openai, fal-client, google-genai, diffusers, matplotlib…) belongs to the API nodes, not to this one.
Worth repeating that this is a single-author personal pack with no real community behind it. The logic is short and readable, so if anything misbehaves you can fix it yourself. For a clean graph, use x5 for day-to-day switching and save the fifteen-case version for the rare workflow that genuinely fans out.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| switch_condition | STRING | — | |
| case_1 | STRING | — | |
| case_2 | STRING | — | |
| case_3 | STRING | — | |
| case_4 | STRING | — | |
| case_5 | STRING | — | |
| input_default | * | — | |
| input_1opt | * | — | |
| input_2opt | * | — | |
| input_3opt | * | — | |
| input_4opt | * | — | |
| input_5opt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |