Nodes/ComfyUI-RvTools_v2/Latent Multi-Switch
ComfyUI Node

Latent Multi-Switch

First one that's alive wins

By r-vage·Created about a year ago·Updated 5 months ago· 23
Latent Multi-Switch
  • input1
  • input2
  • input3
  • input4
  • input5
  • latent

Latent Multi-Switch takes up to five latent inputs and returns the first one that isn't empty. No selector widget, no flip switch - it just scans input1 through input5 and hands back the first slot that has a real value in it. If none of them do, it raises a "Missing Input" error and refuses to run, which is its way of telling you the workflow is under-construed.

That first-non-empty mechanic is the whole personality of this node, and it's genuinely nicer than a manual switch for one big scenario: letting a bypassed node make the choice for you. Here's the pattern the author describes in the README - you have several latent-producing branches (a KSampler output, an encode from an image, an empty latent) and you want to try them one at a time without editing wires. Connect them all to the multi-switch, and simply bypass the ones you don't want right now. Bypassed nodes output nothing, so the switch skips them and picks the first live branch. Toggle a bypass, and the switch silently reroutes.

The gotcha is the flip side of the same mechanic, and the README warns about it explicitly: a node that's always enabled and connected to slot 1 will never be None, so every other slot gets ignored forever. An always-on node in slot 1 is a wall, not a candidate. If you're using this to choose between branches where one of them can't be bypassed (say, the checkpoint loader's output), that one belongs in the last slot so the always-live options sort naturally above it. First slot = most disposable.

Inputs and outputs

  • input1 through input5 (LATENT, all optional) - wire candidates here in priority order.
  • Output latent (LATENT) - the first non-empty one.

Order matters more than anything else on this node. Slot order is the logic.

Installing it

Ships in ComfyUI-RvTools_v2:

cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI-RvTools_v2

Restart ComfyUI or install via ComfyUI Manager (search "RvTools"). No model downloads; dependencies are the standard stack plus opencv-python, pilgram, pynvml, piexif.

Gotchas

The pack README says it's no longer maintained, with ComfyUI_Eclipse (same author) as the successor carrying these nodes forward.

One more thing to internalize: this is a multi-switch for picking the first live input, and there's also a plain Latent Switch in the pack that picks between exactly two via a widget. If you want an explicit selector, use the 2-way; if you want bypass-driven choice, use this one. And the v2 of this node exists too - same first-non-empty logic, plus a Purge_VRAM toggle for when the winner's branch brings a whole new model set into memory.

Category🫦 RvTools II/ Multi-Switches

Inputs (5)

NameTypeDefaultDescription
input1optLATENT
input2optLATENT
input3optLATENT
input4optLATENT
input5optLATENT

Outputs (1)

NameTypeDescription
latentLATENT