Nodes/ComfyUI-SimpleSwitch/Simple Latent Switch (6 Inputs)
ComfyUI Node

Simple Latent Switch (6 Inputs)

The first-non-empty latent, no questions asked

By boobkake22·Created 6 months ago·Updated 2 months ago· 0
Simple Latent Switch (6 Inputs)
  • input01
  • input02
  • input03
  • input04
  • input05
  • input06
  • output

SimpleLatentSwitch is the version of the switch you want when the thing being passed around is a latent and you'd rather not fight with wildcard typing. Six optional LATENT inputs, one LATENT output, and the same logic as its wildcard sibling: return the first non-empty input in order and ignore the rest.

Where it earns its keep: any workflow with several latent-producing branches where you want "whatever actually came out." Say you've got a couple of sampler branches, or a KSampler that can fail to produce, and you want the downstream decoder to always receive a real latent. Wire the branches into input01 through input06 in priority order and let it sort itself out. Because it's typed LATENT on both ends, it plugs cleanly into samplers and VAE decoders without the type warnings a wildcard output can provoke.

How it works

The mechanism is dead simple - the same first-non-empty walk as SimpleSwitch, confined to LATENT values. That simplicity is the point and, quietly, the trap. The node is subtype-blind: it checks that a latent is present, not what kind of latent it is. ComfyUI calls image latents, video latents, and LTX audio latents all "LATENT," and this node will happily forward any of them.

That's fine for plain image-latent routing. It stops being fine around LTX Video, where video latents and audio latents share the LATENT socket but are not interchangeable - the video path expects a plain 5D latent, the audio path a 4D audio latent or a nested AV latent. If you route LTX latents through this node, you can discover the mismatch only later at decode time, after a long generation has already run. That's exactly why the same pack ships SimpleVideoLatentSwitch and SimpleAudioLatentSwitch: use those for LTX branches.

The inputs and outputs that matter:

  • input01input06 - optional LATENT. Only the ones you connect are candidates; priority is connection order.
  • output - the first non-empty LATENT, wired onward to your sampler or decoder.

Installing it

Shared with the rest of the pack: pure Python, zero dependencies, no models. ComfyUI Manager → search "ComfyUI-SimpleSwitch", or:

cd ComfyUI/custom_nodes
git clone https://github.com/boobkake22/ComfyUI-SimpleSwitch.git

Restart ComfyUI and you're done. There's no pip step and nothing to download, which is rare and nice.

The issue to expect

If you get a shape mismatch or decode error downstream, it's usually not this node's fault - it forwarded exactly what you gave it, shape and all. Check which branch actually won and what kind of latent it is. If it's an LTX video workflow, use SimpleVideoLatentSwitch instead; that one inspects the shape before forwarding and tells you why a candidate was rejected. For everything else, this node just works, and that's the whole appeal.

CategorySimple Switch

Inputs (6)

NameTypeDefaultDescription
input01optLATENT
input02optLATENT
input03optLATENT
input04optLATENT
input05optLATENT
input06optLATENT

Outputs (1)

NameTypeDescription
outputLATENT