VAE Decode ? Disk (frames, low RAM)
Your VAE decode is OOMing the system RAM — decode one frame at a time to disk
- samples
- vae
- frames_dir
- frames_saved
- next_start_number
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.autopicks 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_numberexists for append/loop workflows: leave 0 for the legacy behavior, wire it (or thenext_start_numberoutput) 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 intoseam_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.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| samples | LATENT | — | |
| vae | VAE | — | |
| output_dir | STRING | iamccs_vae_frames | Folder (relative to ComfyUI output dir if relative). Frames will be written here. |
| prefix | STRING | frame | — |
| image_format | COMBO | png | 2 options: png, jpg |
| jpg_quality | INT | 951–100 | — |
| tile | BOOLEAN | true | — |
| tiling_mode | COMBO | auto | 2 options: auto, manual |
| tile_size | INT | 51264–4096 | — |
| overlap | INT | 640–4096 | — |
| seam_debug_export | BOOLEAN | false | Export discarded seam-prefix frames and the first kept frames per chunk for debug inspection. |
| seam_debug_dir | STRING | iamccs_seam_debug | Folder for seam-debug exports (relative to ComfyUI output if relative). |
| cleanup_between_frames | BOOLEAN | true | If enabled, runs a light cache cleanup after each frame decode (slower, lower peak VRAM). |
| clear_existing | BOOLEAN | true | If 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_number | INT | 00–100000000 | Starting frame number used when naming written files. Leave at 0 for legacy behavior; increase or wire it only for append/loop workflows. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| frames_dir | STRING | — |
| frames_saved | INT | — |
| next_start_number | INT | — |