Nodes/RuiquNodes for ComfyUI/VAE decode and save image to file
ComfyUI Node

VAE decode and save image to file

One node instead of two

By ruiqutech·Created 2 years ago·Updated 2 years ago· 0
VAE decode and save image to file
  • samples
  • vae
    filename_prefixComfyUI

    Every ComfyUI workflow ends the same way: a latent comes out of the sampler, gets decoded back into pixels, and gets written to disk. Stock ComfyUI makes you do that in two nodes - VAE Decode, then Save Image, with a wire between them. VAEDecodeSave folds both steps into one. Nothing about what it does is new; it just removes a node and a wire from a pattern you wire up in literally every graph.

    What VAE decode is actually doing

    The sampler doesn't work on pixels - it works in latent space, a compressed representation the diffusion model was trained on. The VAE (variational autoencoder) is the component that translates between the two: encode compresses an image down into that latent space, decode expands a latent back out into a full-resolution image you can actually look at. Without a decode step there is no viewable image at all, just a tensor of numbers your sampler was happily denoising. This node does that decode, then immediately writes the result to your ComfyUI output folder - no intermediate IMAGE ever gets exposed for you to grab.

    Inputs and outputs

    Three inputs, no outputs:

    • samples (LATENT) - whatever came out of your KSampler.
    • vae (VAE) - the VAE to decode with, usually straight off your checkpoint loader or a dedicated VAE Loader.
    • filename_prefix (STRING, default ComfyUI) - the base name your files get written under.

    That last point matters: this is an output node with outputs: []. There's no IMAGE socket to hook anything else into. If your plan is decode → upscale → watermark → save, this node isn't it - go back to the plain VAE Decode plus whatever intermediate nodes you need, ending in a Save Image. VAEDecodeSave is specifically for the case where the decode result is the final thing you want written to disk, and you don't want a second node just to save it.

    Where it earns its keep

    Anywhere you're building a graph you'll reuse a lot - an API-deployed workflow, a batch job, a template you hand to other people - cutting the decode-then-save pattern down to one node means one less wire that can get pointed at the wrong VAE or the wrong latent by accident. It's a small thing, but small things compound once you're maintaining a workflow instead of building it once and forgetting about it.

    Installing it

    Open ComfyUI Manager, search RuiquNodes (or the repo name, ComfyUI-RuiquNodes), install, restart ComfyUI. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ruiqutech/ComfyUI-RuiquNodes
    

    then restart. No model weights to download for this one - it's a pure Python utility node, nothing to fetch. Worth knowing going in: this is a small, personal utility pack with essentially no footprint online - no tutorials, no Reddit threads, nothing written about it beyond its own repo. If something goes sideways, the README and the node's own inputs are what you've got.

    Common issues

    A cryptic error like Cannot handle this data type: (1, 1, 12), |u1 right at the decode step. This isn't really a VAEDecodeSave bug - it's what a mismatched VAE looks like. It happens when the vae you wired in doesn't match the model family that produced the latent (a Wan VAE decoding a Qwen-Image latent, for instance). Swap in the VAE that actually belongs to your checkpoint and it clears up.

    Nothing shows up in your output folder. Check that filename_prefix doesn't point somewhere ComfyUI can't write to, and that the run actually reached this node - a node this late in the graph won't execute if something upstream errored first.

    Categoryruiqu/latent

    Inputs (3)

    NameTypeDefaultDescription
    samplesLATENT
    vaeVAE
    filename_prefixSTRINGComfyUI

    Outputs (0)

    No outputs