String Multi-Switch
'give me the first one that's actually connected'
- string
The regular switches in this pack make you pick a slot with an integer. String Multi-Switch is the lazier, more forgiving cousin: it takes up to five string inputs and returns the first one that isn't None. No selector to set, no 1 or 2 to remember - whichever input actually has a value wins, in priority order. The author's own description says it in one sentence: "these switches return the first Slot that is not none."
How it works
The execute() method is a chain of if input1 is not None: return input1; elif input2 is not None: ... down all five slots, falling back to None if everything's empty. The practical consequence is that you control which input wins by what you connect, not by setting a widget. Bypass an upstream node and its input goes None - the switch silently rolls over to the next connected string. That's the entire trick, and it's a good one.
The inputs that matter
input1throughinput5- wire-only STRING inputs (forced input, so no typing in the widget). The author's ordering advice from the README matters here: put the always-on source last. If your always-on checkpoint loader's clip is oninput1, it's neverNone, and every other slot is dead weight. Bypassable candidates go in the front slots, the permanent fallback goes last.
Output is a single string, ready for a CLIP Text Encode, a filename builder, or further text processing.
A concrete use
You're building a workflow with an options menu of prompt variants - a flux dual-CLIP loader, an SD3 triple-CLIP loader, and a plain checkpoint. All three feed this node's inputs; the one whose upstream isn't bypassed wins. When you want a different prompt source, bypass one branch and enable another. No re-wiring, no integer switches to track.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI-RvTools_v2
Restart ComfyUI or use ComfyUI Manager (search "ComfyUI-RvTools_v2"). No models, no special dependencies.
Gotchas
Two things to keep straight. First, "first non-None" is not "first non-empty": an empty string "" is still a value and will win over everything after it. If a branch can produce an empty prompt, that's a real bug waiting for you. Second, the usual pack caveats - this whole pack is deprecated in favor of ComfyUI_Eclipse (which carries the multi-switches over), and old workflows pointing at the dead v1 RvTools repo will throw missing-node errors that Manager can't auto-install. The v2 node names are what you see here.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| input1opt | STRING | — | |
| input2opt | STRING | — | |
| input3opt | STRING | — | |
| input4opt | STRING | — | |
| input5opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| string | STRING | — |