Nodes/IAMCCS-nodes/VAE Decode ? Disk (frames, low RAM)
ComfyUI Node

VAE Decode ? Disk (frames, low RAM)

Your VAE decode is OOMing the system RAM — decode one frame at a time to disk

By IAMCCS·Created 11 months ago·Updated 8 days ago· 113
VAE Decode ? Disk (frames, low RAM)
  • samples
  • vae
  • frames_dir
  • frames_saved
  • next_start_number
output_diriamccs_vae_frames
prefixframe
image_formatpng
jpg_quality95
tiletrue
tiling_modeauto
tile_size512
overlap64
seam_debug_exportfalse
seam_debug_diriamccs_seam_debug
cleanup_between_framestrue
clear_existingtrue
start_number0

Long Wan videos fail in a sneaky place: not in the sampler, but at the end, when VAE decode tries to materialize 500 decoded frames as one giant IMAGE tensor in system RAM. On a 16GB machine that's an OOM crash right at the finish line. IAMCCS_VAEDecodeToDisk is the low-RAM fix - it decodes one frame at a time and writes each straight to disk as a PNG/JPG, so the biggest tensor that ever exists in RAM is a single frame.

How it works

Feed it samples (LATENT) and vae, and it runs the VAE decode loop chunk by chunk, saving to output_dir (relative paths land under ComfyUI's output folder). The controls that matter:

  • tile (default true) + tiling_mode (auto/manual) + tile_size + overlap - tiled decode keeps VRAM flat on big frames. auto picks sensible tile sizes; go manual only if you need to.
  • cleanup_between_frames (default true) - a light cache cleanup after each frame. Slower, lower peak VRAM. Leave it on for tight machines.
  • image_format (png/jpg) + jpg_quality - png for lossless, jpg if disk space is the constraint.
  • prefix + start_number - file naming. start_number exists for append/loop workflows: leave 0 for the legacy behavior, wire it (or the next_start_number output) up if you're chaining extension passes.
  • clear_existing (default true) - wipes older files with the same prefix before writing. Disable only for append/loop runs, or stale frames will pollute your output.
  • seam_debug_export - writes the discarded seam-prefix frames plus the first kept frame per chunk into seam_debug_dir, so you can see exactly what the overlap handling threw away. Turn it on once if something looks off at chunk boundaries.

Outputs are frames_dir, frames_saved, and next_start_number - the last two are the bookkeeping that makes multi-pass extension work. One thing to know: the node forces a re-execute every queue run (IS_CHANGED returns NaN) because writing frames to disk is a side effect - ComfyUI must never skip it via caching, or downstream steps would read stale frames.

When to reach for it

This is the node the README's "Video Performance + Low-RAM Tools" release shipped specifically for long video workflows. If your system RAM (not VRAM) is the wall - which is exactly the SVI/long-clip failure mode, ComfyUI crashing during assembly - decode-to-disk sidesteps it entirely. The frames land on disk ready for a combine node or an external video tool, and downstream works off the folder path instead of a giant tensor.

Install

Part of IAMCCS-nodes:

  • ComfyUI Manager → search "IAMCCS" → install → restart.
  • Or:
cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git

Restart ComfyUI. Requirements: ComfyUI ≥ 0.3.0, Python ≥ 3.12, Torch ≥ 2.8, plus Pillow - the source checks for it and errors with a clear message if it's missing. That's the only extra dependency; everything else is core ComfyUI.

CategoryIAMCCS/HW

Inputs (15)

NameTypeDefaultDescription
samplesLATENT
vaeVAE
output_dirSTRINGiamccs_vae_framesFolder (relative to ComfyUI output dir if relative). Frames will be written here.
prefixSTRINGframe
image_formatCOMBOpng2 options: png, jpg
jpg_qualityINT951–100
tileBOOLEANtrue
tiling_modeCOMBOauto2 options: auto, manual
tile_sizeINT51264–4096
overlapINT640–4096
seam_debug_exportBOOLEANfalseExport discarded seam-prefix frames and the first kept frames per chunk for debug inspection.
seam_debug_dirSTRINGiamccs_seam_debugFolder for seam-debug exports (relative to ComfyUI output if relative).
cleanup_between_framesBOOLEANtrueIf enabled, runs a light cache cleanup after each frame decode (slower, lower peak VRAM).
clear_existingBOOLEANtrueIf enabled, clears older files with the same prefix in output_dir before writing. Default True preserves the legacy behavior used by older workflows; disable only for append/loop workflows.
start_numberINT00–100000000Starting frame number used when naming written files. Leave at 0 for legacy behavior; increase or wire it only for append/loop workflows.

Outputs (3)

NameTypeDescription
frames_dirSTRING
frames_savedINT
next_start_numberINT