Nodes/Dream Project Animation Nodes/β­† Big Latent Switch
ComfyUI Node

β­† Big Latent Switch

Route latents between ten sources without dropping a sample

By alt-key-projectΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 114
β­† Big Latent Switch
  • input_0
  • input_1
  • input_2
  • input_3
  • input_4
  • input_5
  • input_6
  • input_7
  • input_8
  • input_9
  • selected
β—„select0β–Ί
β—„on_missingβ–Ύβ–Ί

Of all the Big switches in this pack, the latent one is the one that earns its keep. Big Latent Switch [Dream] routes between up to ten LATENT inputs, outputting the one you select - and unlike string and number switches, latents are heavy tensors that you genuinely don't want to build twice if you can help it. It's the node for "feed this frame's latent to the sampler, or that branch's latent, depending on where I am."

How it works

The standard pack switch skeleton: input_0 through input_9 carry the latents, select (INT 0–9) chooses which one is output as selected, and on_missing (previous/next) handles the case where the chosen slot is empty by walking to the nearest connected input. Latent slots have no sentinel value - an empty slot is simply None - so the fallback just skips it.

The inputs that matter

  • select - INT, 0–9.
  • on_missing - previous or next.
  • input_0 … input_9 - the candidate latents.

Where it fits

The classic use is a two-branch animation pipeline: a "first frame" path that starts from an Empty Latent, and a "continue" path that takes the previous frame's latent - with the switch choosing per frame. It's also handy for A/B routing between samplers. The honest caveat is the one that applies to all the eager switches: because every input is evaluated, a heavy sampler upstream of the unselected branch still runs. For latents that matters more than for floats - if your branches are expensive, the switch won't save you the compute, only the rewiring.

Installing it

Ships with Dream Project Animation Nodes - ComfyUI Manager (search Dream Project Animation) or clone https://github.com/alt-key-project/comfyui-dream-project into custom_nodes, pip install -r requirements.txt, restart. No model downloads.

Common issues

Same family gotchas - 0-indexed slots, on_missing quietly papering over wrong indices. The one latent-specific thing to know: the output carries whatever latent tensors you fed it, so keep batch shapes consistent between inputs; switching between a latent of batch size 1 and one of batch size 4 mid-graph will surprise your sampler. Match your branches' shapes and this node is boring in the best way.

Category✨ Dream/πŸ›  utils/β­† switches

Inputs (12)

NameTypeDefaultDescription
selectINT00–9β€”
on_missingCOMBO2 options: previous, next
input_0optLATENTβ€”
input_1optLATENTβ€”
input_2optLATENTβ€”
input_3optLATENTβ€”
input_4optLATENTβ€”
input_5optLATENTβ€”
input_6optLATENTβ€”
input_7optLATENTβ€”
input_8optLATENTβ€”
input_9optLATENTβ€”

Outputs (1)

NameTypeDescription
selectedLATENTβ€”