Nodes/IAMCCS-nodes/VRAM Flush ? Latent passthrough (empty cache)
ComfyUI Node

VRAM Flush ? Latent passthrough (empty cache)

A one-input node that rescues long video runs from the OOM

By IAMCCS·Created 11 months ago·Updated 8 days ago· 113
VRAM Flush ? Latent passthrough (empty cache)
  • latent
  • latent

This is the smallest node in the pack and one of the most useful. VRAM Flush Latent has exactly one input, one output, and does one thing: it calls torch.cuda.empty_cache() - flushing PyTorch's reserved CUDA pool - and passes your latent through completely unchanged. That's the whole node.

Why that matters: video decoding is a VRAM hoarder. VideoVAE and friends reserve memory in the PyTorch CUDA allocator's pool and don't hand it all back when they're done, even after the tensors are freed. On a 12GB card running a long LTX 2.x extension workflow, that reserved-but-unused memory is the difference between a smooth next segment and a hard OOM crash mid-run. Dropping this node between passes tells the allocator "hey, actually give that back to the driver" right before the next heavy stage.

How to use it

The description tells you exactly where it belongs: between two sampler passes, e.g. after LTXVLatentUpsampler / LTXVConcatAVLatent and before the second SamplerCustomAdvanced. Chain it like this:

first sampler → concat/upscale → VRAM Flush → second sampler

The latent flows through untouched - this is a passthrough, not a transform - so it's safe to splice into an existing graph without changing any numbers. The pack's own SuperNodes use it under the hood when vram_flush is enabled, which tells you it's the sanctioned way to reclaim VRAM rather than a hack.

Install

Part of IAMCCS-nodes:

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

or via ComfyUI Manager (search "IAMCCS"), then restart. No dependencies beyond PyTorch/CUDA - which you already have.

The honest caveats

empty_cache() isn't free. The allocator has to do work to actually release and later re-reserve, so sprinkling this node everywhere can slow a run - it's a rescue tool, not a performance enhancer. Use it where you'd otherwise OOM, not as decoration. Second: it flushes PyTorch's cache, but if the VRAM is genuinely held by a live tensor (a big model that's still resident), this node won't conjure space out of nowhere. If you're still OOM after flushing between passes, the problem is model residency, and the fix is offloading - the pack's GGUF accelerator and low-RAM disk decode modes (also in this pack) are the real answers there.

CategoryIAMCCS/HW

Inputs (1)

NameTypeDefaultDescription
latentLATENT

Outputs (1)

NameTypeDescription
latentLATENT