ComfyUI Node

Latent to RGB

The Cheapest Way to Turn a Latent Into an Actual Image

By martijnat·Created 3 years ago·Updated 11 months ago· 47
Latent to RGB
  • latent
  • image
base_model

Every other node in this pack saves a temporary PNG and quietly passes the latent through. LatentToRGB does something different: it hands you a real IMAGE tensor. That makes it the odd one out, and for the right job, the most useful one.

Here's the mechanism. Instead of decoding with the VAE - the expensive step that costs real VRAM and seconds - the node forces ComfyUI's latent2rgb preview method and runs the decode. That's a trivial per-channel transform that maps the latent's channels straight to RGB. It's ugly: washed-out, low-contrast, nothing you'd ever ship. But it's essentially free, and unlike the pack's other nodes it returns the decoded image into the graph rather than just showing it to you. That's the whole point. You're not getting a render; you're getting a cheap look at what's in the latent that you can feed anywhere an image is expected.

That last bit is what makes it genuinely useful. Want a downscaled proof image to stuff into an image viewer, a comparator, or a batch process without paying for a VAE pass per item? This is your node. It's also a decent inline sanity check: wire it into your graph where a temporary "is my prompt landing?" peek is worth more than waiting for the final decode.

Inputs and output

  • latent (LATENT) - the latent to convert.
  • base_model (enum) - SD15, SDXL, SD3, Flux, Wan21, Wan22, LTXV. This picks the right latent scale factor. Pick the family your latent came from, or the colors will be off - same rule as PreviewLatentAdvanced.

The output is a single image (IMAGE) tensor, at the latent's full resolution. Because this node returns an image instead of just showing one, it's not an output node - you wire it into whatever consumes images next: Save Image, an upscaler, a batch, a video viewer. And unlike the preview nodes, it doesn't write any temp file or metadata; it's a pure in-graph conversion.

Why you might prefer it over the preview nodes

The preview nodes (PreviewLatent, PreviewLatentXL, etc.) are output nodes that save temp PNGs and forward the latent. LatentToRGB is the one that returns pixels. So the decision is simple: if you want to see it, use a preview node; if you want to use the cheap decode downstream, use LatentToRGB. One more honest caveat - the quality ceiling is low. latent2rgb is a crude mapping, so don't reach for it when the decoded image is going to be judged, upscaled, or fed back into an img2img pass. That's what the VAE is for. This is a placeholder, a preview, a speed hack - a good one.

Installing

Same as the rest of the pack: ComfyUI Manager (search "comfyui-previewlatent"), or clone https://github.com/martijnat/comfyui-previewlatent into ComfyUI/custom_nodes/ and restart. No requirements.txt, no model files to download - latent2rgb needs nothing. It's the zero-friction member of the family.

Categorylatent

Inputs (2)

NameTypeDefaultDescription
latentLATENT
base_modelCOMBO7 options: SD15, SDXL, SD3, Flux, Wan21, Wan22, +1

Outputs (1)

NameTypeDescription
imageIMAGE