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

Simple Video Latent Switch (6 Inputs)

The latent switch that only lets video through

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

Around LTX Video, "switch on the LATENT socket" gets dangerous, because audio and video latents both call themselves LATENT but are not the same thing at all. SimpleVideoLatentSwitch is the fix: six optional LATENT inputs, one LATENT output, and it forwards only the first latent that is actually a plain, non-nested 5D video latent. Everything else gets skipped - or, if nothing qualifies, the node refuses to guess and tells you exactly why.

You reach for it in multi-branch LTX video workflows. The classic LTX pattern is to run several branches - image-to-video, text-to-video, an extended clip - and route whichever produces a usable video latent into sampling and decode. A subtype-blind switch will happily forward an audio latent or a nested AV container into the video path, and you find out at LTXV VAE Decode, after the whole generation has already run. This node catches that up front: it only passes non-nested 5D latents, which is what the video decode path expects.

How it works

From the source: it walks input01 through input06, skips anything that's None, and checks each remaining candidate against three rules - it must be a latent dict with samples, the samples must not be a nested tensor, and the tensor must be 5-dimensional. First match wins and comes out as output. If every candidate fails, it raises a ValueError listing each rejected input with its type, nested flag, ndim, and shape. That error message is a feature: instead of a cryptic decode crash you get a line saying "input03 is a 4D audio latent, here's why it isn't video."

The inputs and outputs that matter:

  • input01input06 - optional LATENT. Wire your video-branch latents in the priority order you'd prefer.
  • output - the first 5D non-nested video latent, going to your sampler or VAE decode.

Installing it

Same zero-fuss story as the rest of the pack - pure Python, no dependencies, no model files. ComfyUI Manager search "ComfyUI-SimpleSwitch", or:

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

Restart ComfyUI and refresh the browser.

When it complains

If you hit "No compatible video latent found," read the rejected list - it names the offender and its shape. The usual culprit is wiring an audio or AV branch into a video position, or connecting something that isn't a latent at all. And one caveat worth knowing: "video latent" here means "5D non-nested," which covers LTX and other video models that store their latents that way. It's not LTX-locked, just shape-locked - which is exactly the right kind of strict for this job.

CategorySimple Switch

Inputs (6)

NameTypeDefaultDescription
input01optLATENT
input02optLATENT
input03optLATENT
input04optLATENT
input05optLATENT
input06optLATENT

Outputs (1)

NameTypeDescription
outputLATENT