Nodes/ComfyUI-RvTools_v2/Pass Latent v2
ComfyUI Node

Pass Latent v2

A latent reroute with a VRAM flush button

By r-vage·Created about a year ago·Updated 5 months ago· 23
Pass Latent v2
  • latent
  • LATENT
Purge_VRAMfalse

Pass Latent v2 is the plain Pass Latent with one useful addition bolted on: a Purge_VRAM toggle. Same idea - a LATENT goes in and the identical LATENT comes out - but flip the toggle and the node also runs a memory flush on its way through, which makes it a reroute and a VRAM pressure-release valve in one.

Here's the mechanism, straight from the source. When Purge_VRAM is true, the node calls gc.collect(), then on CUDA torch.cuda.empty_cache() and ipc_collect(), then comfy.model_management.unload_all_models() and soft_empty_cache(), and only then returns your latent. Translation: it empties PyTorch's cache, tells ComfyUI to evict every loaded model from VRAM, and hands the latent along. It's a deliberately blunt instrument - it does not care which model you might want to keep warm. The latent itself is untouched, so downstream sampling is unaffected apart from having to reload its models.

That's actually the useful part for big workflows. If you're chaining a heavy checkpoint, then a different model, then another - think an initial SDXL pass followed by a dedicated upscaler or a detail model - the standard failure is an out-of-memory crash right at the handoff. Dropping a Pass Latent v2 with Purge_VRAM on at that boundary forces the old model out before the next one loads. The trade-off is real: unload_all_models means the next node has to reload its model from disk, so you pay a few seconds of load time every time it fires. Put it at stage boundaries, not mid-pipeline, and treat it as a "my workflow OOMs here" fix rather than a default-on habit.

Like every passer in the pack, it also earns its keep as a stable junction - one latent fanning out to several consumers, with the source easily swap-able without ripping up downstream wires. The v2 naming just marks the extra widget.

Inputs

  • latent (LATENT, required) - the latent to pass through.
  • Purge_VRAM (BOOLEAN, default false) - when enabled, flushes CUDA cache and unloads all models before passing.

Output is a single LATENT, unchanged.

Install

Ships in ComfyUI-RvTools_v2. ComfyUI Manager → search "ComfyUI-RvTools_v2" → install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI-RvTools_v2

Restart, then find it under RvTools II / Passer. No models to download; the pack's pip requirements are the usual torch/numpy/Pillow stack plus opencv-python, pilgram, pynvml, piexif.

Keep in mind

The pack is deprecated in favor of ComfyUI_Eclipse, which folds most RvTools nodes in - fine to keep using, just frozen here. And note this is not a general memory management tool: Purge_VRAM is all-or-nothing, so on a single-model workflow it's usually wasted effort. Reach for it when a multi-model graph is OOMing at a handoff, not before.

Category🫦 RvTools II/ Passer

Inputs (2)

NameTypeDefaultDescription
latentLATENT
Purge_VRAMBOOLEANfalse

Outputs (1)

NameTypeDescription
LATENTLATENT