Preview Latent (Stable Diffusion)
See Your Latents Without Paying the VAE Tax
- latent
- latent
ComfyUI already shows you a little preview next to the KSampler as it runs - but it's a tiny, 512x512 downscale, it only appears at the end of the sampler, and if you're working with intermediate latents it's just not there. PreviewLatent is the node you drop into the wire when you want to actually look at a latent without paying for a full VAE decode. The author (martijnat on GitHub, who announced the pack on r/comfyui back in late 2023) built it for one reason: showing intermediate results cheaply, and it doubles as a fast "Preview Image" when you'd rather not run the VAE.
The name is a bit of a lie, in the good way. It doesn't decode to pixels and give you back an image - it forwards the latent straight through and also writes a temporary preview PNG so you can see what's in the pipeline. The preview uses ComfyUI's own latent_preview machinery: TAESD if a decoder is available, otherwise a plain latent2rgb decode. Both are tiny and fast compared to the real VAE, at the cost of a slightly rough, washed-out look. For checking composition and prompt direction mid-graph, that trade is a steal.
Why this node exists instead of just the built-in KSampler preview: those are capped at 512x512 and only cover the sampler's own output. PreviewLatent renders at full resolution and works on any latent tensor in your graph - feed it an intermediate step, an img2img latent, a low-noise result you want to inspect before committing to a decode. Because it passes the latent through unchanged, you can drop it into the middle of a chain like a reroute node and it won't break anything. It's also an output node: right-click the preview and "Save Image" writes the full workflow metadata into the PNG, same as a normal Preview Image node.
Inputs and outputs
There's exactly one input that matters:
- latent (
LATENT) - the latent tensor you want a peek at. Wire it from your KSampler, VAE Encode, or anywhere else a latent flows.
And one output, also called latent (LATENT), which is the same latent untouched. That's the whole node. Simple by design.
One honest warning before you use it: the basic PreviewLatent assumes the SD1.5 latent format (it hardcodes the SD1.5 scale factor). If you feed it SDXL or Flux latents, the preview will look wrong - off-color and oddly contrasted - because those models live in a different latent space. Use PreviewLatentXL or PreviewLatentAdvanced for those, or the plain node will lie to you.
Installing
Install from ComfyUI Manager (search "comfyui-previewlatent" or "Preview Latent"), or the old-fashioned way:
cd ComfyUI/custom_nodes
git clone https://github.com/martijnat/comfyui-previewlatent
Then restart ComfyUI. That's it - the pack has no requirements.txt and pulls in zero extra Python packages; it runs entirely on ComfyUI's built-in modules. If you want the nicer TAESD previews, drop a taesd_decoder.pth into ComfyUI/models/vae_approx/ - without it the node silently falls back to latent2rgb.
Troubleshooting
- Preview is ugly. That's latent2rgb doing its thing, or a model/latent-format mismatch. It's a preview, not the render - judge composition here, quality at the VAE.
- TAESD isn't faster than VAE decode. A real community report, not a myth: on some setups the tiny decoder is actually slower than the full VAE. latent2rgb is the speed king. If auto is slow for you, that's your answer.
- Node won't load / import errors. The pack imports ComfyUI's
latent_formatsmodule directly at startup, including newer classes for Flux, Wan, and LTXV. On a stale ComfyUI install it fails before it even shows up. Update ComfyUI first. - Temp files piling up. Previews go to ComfyUI's temp directory, not your output folder - they're meant to be throwaway, which is fine, but know where they live if you go hunting.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |