Nodes/Tojioo Passthrough/Any VAE Switch
ComfyUI Node

Any VAE Switch

Route the VAE you actually want, by slot order

By Tojioo·Created 11 months ago·Updated 7 months ago· 13
Any VAE Switch
  • vae_1
  • vae

Any VAE Switch picks the first connected VAE by slot order and hands it to the vae output. The VAE is the wire people are constantly swapping - the checkpoint's built-in VAE here, a fine-tuned fp16-fix VAE there - and it feeds both VAE Encode and VAE Decode. This node lets you keep both loaded and switch by mute instead of re-wiring both ends of every encode/decode.

It's the first-non-null switch shape the community uses everywhere (rgthree's Any Switch is the canonical one), typed to VAE so the socket can't take anything else.

How it works

Start with vae_1; connect another VAE source and a vae_2 slot grows, and so on. On execution it collects the connected inputs that aren't None and returns the lowest-numbered one. Muted and bypassed upstream nodes deliver None - and those are skipped - so muting the loader feeding vae_1 lets vae_2 take over automatically. Connect nothing and it raises "no inputs connected" rather than returning an unloaded VAE.

Where you'd use it

  • Checkpoint VAE vs. standalone VAE. The classic fix: swap in a known-good VAE without re-wiring the whole encode/decode chain.
  • Compare two VAEs. A/B two VAE files, one decode path, mute to flip.
  • Fallback routing. Preferred VAE first, fallback second.

Install

ComfyUI Manager → search "Tojioo Passthrough" → install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Tojioo/tojioo_passthrough.git

Restart ComfyUI. No models or pip dependencies - the pack is Python plus a bundled frontend, on the Comfy Registry under publisher tojioo.

Common issues

Slot order is everything: a live vae_1 always beats vae_2, so if the "wrong" VAE is decoding, the earlier slot's upstream is muted, bypassed, or unwired - muting is your switch. This node selects one VAE; it doesn't combine. And remember VAE Decode is one of those nodes that fails visibly when fed a mismatched VAE - a red error and a dead output - so when you swap, make sure the VAE actually matches the checkpoint's latent space. Keep at least one slot wired or the node errors on the canvas.

CategoryTojioo Passthrough/Dynamic Nodes/Switch Nodes

Inputs (1)

NameTypeDefaultDescription
vae_1optVAE

Outputs (1)

NameTypeDescription
vaeVAE