Nodes/ComfyUI-Creepy_nodes/Dynamic Latent Switch (Creepybits)
ComfyUI Node

Dynamic Latent Switch (Creepybits)

Pass the Latent That Actually Exists

By Creepybits·Created about a year ago·Updated 2 months ago· 32
Dynamic Latent Switch (Creepybits)
  • latent1
  • latent2
  • latent3
  • LATENT
  • show_help

The Dynamic Latent Switch is the latents-flavored member of the pack's "first non-empty wins" switch family. Up to three latent inputs (latent1, latent2, latent3), no selector, no settings - it outputs the first one that has something connected, or None if all three are empty. For anyone who's already seen the Dynamic Image or Model switches, this is the same two-line idea wearing a LATENT-shaped hat.

What you're actually choosing between

Latents are the compressed image representation the sampler works on, so this switch's job is deciding which latent space to start from. The realistic scenarios:

  • Img2img vs. txt2img on one graph. A VAE Encode of a source image gives you an img2img latent; an Empty Latent gives you a txt2img start. Wire the encode into latent1 and the empty latent into latent2, and the switch prefers the real image when it exists, falling back to a blank canvas.
  • Loop/batch fallbacks. In a loop that occasionally produces a latent and occasionally doesn't, this keeps a single latent flowing to the KSampler without a branch.
  • Compositing choice. Two branches generate different base latents (say, a full-frame latent and a padded crop); the switch picks whichever branch actually ran.

Outputs: LATENT plus the pack's standard show_help string (the "proverb of the day" easter egg, not documentation).

The honest limitations

Because there's no selector, you can't actively pick between two connected latents - if both are wired, latent1 wins, period. If you need runtime choice, you want a real latent switcher with an index input (the pack's Multi switches give you that for models and CLIPs; for latents, look at the core/comfyui switch or rgthree-style utilities). And the None trap applies here harder than most places: feed None into a KSampler's latent input and it will fail loudly. Always keep latent3 (or latent2) as a guaranteed non-empty default.

Where it fits

This is a utility node, not a headline feature - you'll grab it when building a graph that needs "prefer this latent, else that one" and you're tired of manually reconnecting. It shares a category (Creepybits/Switches) and a code pattern with the pack's Dynamic Model, CLIP, VAE, and Image switches, so once you understand one, you understand them all: positional priority, None propagation, zero config.

Installing it

It ships with the whole Creepybits pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Creepybits/ComfyUI-Creepy_nodes.git

Restart ComfyUI, or find "Creepy" in ComfyUI Manager. No model downloads; the pack's requirements install on first launch. It won't change your life, but when you need a fallback chain for latents, this is the node that's already on your canvas.

CategoryCreepybits/Switches

Inputs (3)

NameTypeDefaultDescription
latent1optLATENT
latent2optLATENT
latent3optLATENT

Outputs (2)

NameTypeDescription
LATENTLATENT
show_helpSTRING