Nodes/Tojioo Passthrough/Latent Passthrough
ComfyUI Node

Latent Passthrough

Route the compressed image without touching it

By Tojioo·Created 11 months ago·Updated 7 months ago· 13
Latent Passthrough
  • latent
  • latent

The latent is the compressed form of your image - the thing the sampler actually works on before anything gets decoded back to pixels. And precisely because it's a heavy, valuable object, it's one of the types you least want to shove through a decode/encode round trip just to move it across a graph. The Latent Passthrough hands it through untouched: one optional latent socket in, the same latent out, no VAE involved anywhere in between.

That "no VAE involved" is the whole point. Every time you decode a latent to an image and re-encode it, you pay a lossy round trip - real quality you don't get back. If you just need the latent to reach a sampler, an upscale-in-latent node, or an img2img source, a passthrough keeps it in latent space the whole way. It's also the natural companion to latent-space upscaling, where you scale the latent itself rather than decoding first.

How it works

Standard simple-passthrough machinery: the run function is return (kwargs.get("latent"),). Read it, hand it back unchanged. Two behaviors to know:

  • Unconnected means None. Leave the socket empty or mute/bypass the feeding node, and the output is None. Fallback-friendly, but a sampler downstream will trip over it.
  • Connect-only. No widget - you can't type a latent into existence. It has to come from a VAE encode, an Empty Latent, or another latent-producing node.

Inputs and outputs

  • latent (LATENT) in → latent (LATENT) out.

One pair. The output plugs into any LATENT socket - KSampler, latent upscale, latent blend, whatever. It's under Tojioo Passthrough → Simple Passthrough.

Install

Manager → search "Tojioo Passthrough" → Install → restart, or:

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

No models, no pip deps, prebuilt frontend. Small single-maintainer pack, GPL-3.0.

Common issues

The usual trap is the None handoff: mute the VAE-encode upstream to try a different branch and the sampler downstream errors on a missing latent - the passthrough reports "nothing" without complaint. Check upstream before blaming the sampler. One more practical note: this node doesn't change the latent's resolution or batch count, and it doesn't clone or protect it - if you need a separate copy of a latent for two branches, generate or encode a second one rather than fanning out the same object and hoping.

CategoryTojioo Passthrough/Simple Passthrough

Inputs (1)

NameTypeDefaultDescription
latentoptLATENT

Outputs (1)

NameTypeDescription
latentLATENT