Nodes/ComfyUI_RaykoStudio/๐ŸฆŠ RS Decode Save Image
ComfyUI Node

๐ŸฆŠ RS Decode Save Image

VAE Decode + Save in one node, because the chain is boring

By RaykosanยทCreated about a year agoยทUpdated about 9 hours agoยท 79
๐ŸฆŠ RS Decode Save Image
  • samples
  • vae
  • image
โ—„save_pathโ–บ
โ—„file_prefiximgโ–บ
โ—„formatpngโ–บ
โ—„node_data{}โ–บ

Every generated image in ComfyUI ends the same way: VAEDecode turns your latent back into pixels, then SaveImage writes it to disk. Two nodes, one wire, zero thinking - which is exactly why this pack merged them. RS Decode Save takes a LATENT and a VAE, decodes, saves, and passes the decoded image forward, all in one node. It's not a feature; it's a tidy-up. But tidy-ups earn their place when they remove a node from every single graph you build.

How it works

On execution it does what VAEDecode + SaveImage would have: decode samples with vae, write the result to your output/ folder, and hand the IMAGE tensor out the other side for preview or further processing. Because it's still a save node, it inherits the good defaults:

  • Prefix with subfolders - filename_prefix takes paths, so project/render lands in output/project/render/. Standard ComfyUI save-path logic, nothing custom.
  • Format choice - png, jpg, or webp via the format dropdown.
  • Auto-numbering - _00001, _00002, โ€ฆ just like stock.
  • Metadata - PNGs get the full workflow embedded (drag-and-drop reconstruction still works); other formats get sidecar JSON.
  • Output preserved - the decoded image output is there, so you can chain a preview or a post-process node off the same tensor that got saved. That's the one thing stock VAE Decode โ†’ SaveImage makes awkward.

Inputs are the minimal four: samples (LATENT, from your sampler), vae (VAE), filename_prefix (default ComfyUI), and format.

Where it fits

It's for graphs where the tail is a boring mechanical step and you'd rather not dedicate two nodes to it. Batch renders especially: with a %batch_num%-style prefix you can chain it onto a batch sampler and let every frame decode and save without a trailing node pair. If you need the decoded image for something more interesting than saving - a face-fix pass, an upscale, a comparison - then a separate VAEDecode gives you more freedom. This node is the "I just want it saved" path.

Worth a small hat-tip: the changelog notes a security hardening pass specifically on this node (path-traversal prevention on the save path). For a save node that's the right instinct - it means filename prefixes are sanitized, so you're not writing files outside your output tree by accident or malice.

Common issues

  • Save path unexpectedly empty - check the prefix. A / in filename_prefix creates a subfolder, so project/render means output/project/render/, not output/projectrender/.
  • JPG looks different from PNG - JPG/WebP are lossy and drop the alpha channel; that's the format, not the node. PNG is the faithful default.
  • Missing workflow in JPG/WebP - those formats can't embed the full workflow the way PNG does, hence the sidecar JSON. If you share a JPG and lose the sidecar, the graph is gone.

Installing it

Part of the RaykoStudio pack. ComfyUI Manager โ†’ search ComfyUI_RaykoStudio โ†’ install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Raykosan/ComfyUI_RaykoStudio

Restart ComfyUI. Dependencies (pycairo, opencv-python, scipy, Pillow>=10) install via Manager; a manual clone needs pip install -r requirements.txt. Apache 2.0, tested on ComfyUI 0.15+, Python 3.10+, Torch 2.8+.

Category๐ŸฆŠ RaykoStudio

Inputs (6)

NameTypeDefaultDescription
samplesLATENTโ€”
vaeVAEโ€”
save_pathSTRINGโ€”
file_prefixSTRINGimgโ€”
formatCOMBOpng3 options: png, jpg, webp
node_dataSTRING{}โ€”

Outputs (1)

NameTypeDescription
imageIMAGEโ€”