Nodes/VELVET VICE — LTX/VELVET VICE LTX — Final Memory Cleanup
ComfyUI Node

VELVET VICE LTX — Final Memory Cleanup

The end-of-render 'put the VRAM back' node — legacy three-preview version

By Velvet-Vice·Created 25 days ago·Updated 10 days ago· 2
VELVET VICE LTX — Final Memory Cleanup
  • final_video
  • original_preview
  • selected_preview
  • cleanup_report
unload_render_modelstrue

ComfyUI doesn't automatically unload your models between renders. Finish one LTX clip and the 22B model, both VAEs, and the text encoder stay parked in VRAM, ready for the next queue - which is fine until the next queue needs more room than you have. VelvetViceLTXFinalMemoryCleanup is the pack's capstone: a node that waits until the render is genuinely finished, reports how bad the memory peak got, and then unloads the tracked models.

What it does

It takes three VHS_FILENAMES inputs - final_video, original_preview, and selected_preview - which is its way of saying "don't run me until the video and both previews are saved." Being wired to those outputs guarantees it executes last, after the actual work is done. Then it:

  1. Stops the render memory monitor (the background sampler started by the Lazy Model Gate) and reports the session's numbers: duration, sample count, peak RAM percentage, minimum RAM available, and minimum VRAM free.
  2. Unloads every ComfyUI model the pack has been tracking - the LTX model, CLIP, VAE caches - via cleanup_comfy_models_after_render().
  3. Returns a cleanup_report string with all of that, which shows up in the UI and console.

The unload_render_models toggle (default on) lets you skip the unload and only get the report, if you're debugging.

Legacy, but not wrong

The display name doesn't say it, but this node is the legacy three-output cleanup. The current workflow uses VelvetViceLTXSingleOutputCleanup - the pack moved from "final video plus two previews" to a single selected output, and this older node is retained so v1.1-era workflow files keep loading. If you're building fresh, prefer the Single Output Cleanup; if you're loading an old workflow, this one works exactly as it always did.

Like its sibling, IS_CHANGED returns NaN so it always runs - a node whose job is to fire once per render can't be allowed to cache "already done."

Why the workflow needs it

The Velvet Vice memory story is a chain of handoffs: the Lazy Model Gate keeps the big model from loading too early, the Pre-Decode Memory Gate frees the sampler before the decode, the memory checkpoints show you the peaks - and this node sweeps up at the end. If you render one clip, then a second, that cleanup is the difference between "queued fine" and "CUDA out of memory" on render two.

Inputs and outputs

  • final_video, original_preview, selected_preview - all VHS_FILENAMES; the ordering dependencies that place this node last.
  • unload_render_models - boolean, default true.
  • Output: cleanup_report (STRING). Output node.

Installing it

Part of VELVET VICE - LTX (velvet-vice-ltx) via ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Velvet-Vice/velvet-vice-ltx

Restart and hard-refresh with Ctrl+F5. No pip deps; needs the pack's memory-lifecycle service (bundled).

Troubleshooting

  • The report says "render monitor was not active" - expected if your graph doesn't include the Lazy Model Gate that starts the monitor. The unload still runs.
  • Models not unloading - unload_render_models got flipped off somewhere, or the node is cached. Re-check the toggle; NaN IS_CHANGED should prevent caching.
  • This node never runs - it executes only after all three filename inputs resolve. If a preview node was skipped (e.g., after an interrupt), it won't fire - which is exactly why the pack installs its separate interruption-only cleanup hook for the failure case.

Not a glamorous node, but it's the reason a second render doesn't randomly OOM - and the legacy naming is a good reminder to check which cleanup node your workflow actually pins.

CategoryVELVET VICE/LTX

Inputs (4)

NameTypeDefaultDescription
final_videoVHS_FILENAMES
original_previewVHS_FILENAMES
selected_previewVHS_FILENAMES
unload_render_modelsBOOLEANtrue

Outputs (1)

NameTypeDescription
cleanup_reportSTRING