Nodes/DemonAlone-nodes-ComfyUI/Conditional VAE Decode Preview
ComfyUI Node

Conditional VAE Decode Preview

A decode you can switch off

By DemonAlone·Created 7 months ago·Updated 22 days ago· 3
Conditional VAE Decode Preview
  • samples
  • vae
  • LATENT
  • IMAGE
previewfalse

A normal VAE Decode runs every single time your graph executes - there's no way to tell it "skip this one, I don't need to look at it right now" without physically disconnecting the wire. Conditional VAE Decode Preview fixes that with one boolean toggle: flip preview on and it decodes your latent to an image like usual; flip it off and it becomes a plain reroute, passing the original latent through untouched and doing no decode work at all.

Why this matters for the graphs this pack was built for

DemonAlone's own README frames this pack as built around XYZ-plot-style pipelines - sweeping a parameter (checkpoint, sampler, CFG) across a grid and collecting a lot of results. In that context, a VAE decode on every single latent in the sweep is real, avoidable cost: decoding is not free, and if you're only spot-checking a handful of results out of dozens, you're paying for decodes you'll never look at. This node lets the decode step live permanently in the graph - wired once - and you toggle it per-run instead of rewiring around a VAE Decode every time you want to switch between "just accumulate latents fast" and "let me actually see one."

It's also a convenient way to add an optional preview tap partway through a longer latent-space pipeline (before an upscale pass, say) without a separate branch cluttering the canvas.

The inputs and outputs

  • samples (LATENT, required) - the latent to conditionally decode.
  • vae (VAE, required) - the VAE to decode with, when enabled.
  • preview (BOOLEAN, default false) - the author's own description for this one is exact: "Preview and Image Output." Off by default, so dropping this node into a graph doesn't silently add decode cost until you turn it on.

Two outputs: LATENT (the original latent, unchanged either way - always safe to chain further latent-space work off this) and IMAGE (only meaningfully populated when preview is true; when it's false the node is acting as a reroute and doesn't decode). Wire LATENT onward to whatever continues your pipeline, and IMAGE to a Preview Image or Save node for the cases you actually want to look at.

How to install it

ComfyUI Manager: search DemonAlone-nodes-ComfyUI, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/DemonAlone/DemonAlone-nodes-ComfyUI

then restart. No extra dependencies - it wraps the same VAE decode ComfyUI already ships with, no separate model download needed beyond whatever VAE you're already using.

Common issues & troubleshooting

I flipped preview on but got no image, or an old one. Confirm the boolean is actually reaching this node's preview input and not left at its false default on an unconnected widget - it's easy to assume a checkbox is set when you haven't actually toggled it since dropping the node.

This is slower than I expected even with preview off. The decode itself is skipped, but you're still paying for whatever generates the latent upstream (the sampler). This node only saves the VAE decode step, not the sampling that produced the latent in the first place.

I want to preview every Nth result in a batch/grid, not toggle by hand. This node's preview input just takes whatever boolean you wire into it - drive it from a computed condition (an index check, a counter comparison) instead of a manual switch if you want automatic "preview every 5th run" behavior across an XYZ-style sweep.

Output image looks wrong or oversaturated. That's a VAE mismatch, not this node - same troubleshooting as any VAE Decode: confirm you're using the correct VAE for your checkpoint (SDXL VAE on an SDXL model, and so on), not this node's own logic.

Categorycustom_nodes

Inputs (3)

NameTypeDefaultDescription
samplesLATENT
vaeVAE
previewBOOLEANfalsePreview and Image Output

Outputs (2)

NameTypeDescription
LATENTLATENT
IMAGEIMAGE