Gigachad Cache Cleanup
Out of VRAM mid-workflow? This passthrough node reports exactly how much you freed
- any_input
- any_output
Gigachad Cache Cleanup is the node you drop into a workflow when a long run keeps stalling, and you'd honestly rather know why than keep guessing. It's a passthrough: give it anything - a latent, an image, a string, a model - and it hands the exact same thing back out the other side. Nothing changes except the timing report you get in the node UI.
So why does it exist? It calls torch.cuda.empty_cache() and Python's garbage collector before the next heavy operation. The honest framing: ComfyUI already frees the CUDA cache between executions, so this won't rescue you from a genuinely too-big model. What it does give you is a live readout of free vs. total VRAM in gigabytes, plus how long the cleanup took in milliseconds. That's the real product - a memory meter you can leave parked at the spot in your graph where things usually die.
What you actually touch
The inputs are a "gadget shortlist" and nothing more:
any_input- optional, accepts any type, passes straight through. Wire whatever you're about to use downstream.empty_cache(default on) - toggletorch.cuda.empty_cache().gc_collect(default on) - toggle Python garbage collection.
The single output is any_output, which is the same value you fed in. Because the node is marked as an output node, its elapsed_ms, vram_free_gb, and vram_total_gb values are pushed to the UI every run - that's the timer you see on the node.
Where it fits
The pack README suggests parking one after your KSampler and before upscaling. That's a reasonable spot: decode and upscale passes are where VRAM spikes. But the node works anywhere, and because it's a passthrough it won't break connections if you remove it later. It's also handy as a diagnostic - run a workflow with it at various points and you'll see which stage is actually eating your card.
Install and gotchas
Everything in this pack installs the same way. ComfyUI Manager: search comfyui-gigachad. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Winnougan/comfyui-gigachad.git
Then restart ComfyUI. The pack ships no requirements.txt - this node is pure PyTorch + ComfyUI, so nothing extra to install.
Two things to know. First, on a CPU-only box empty_cache silently does nothing (the code checks torch.cuda.is_available()); you'll still get the garbage-collection pass. Second, don't read the freed number as "my model unloaded" - empty_cache releases cached allocator blocks, not the live model weights sitting in VRAM. If you're trying to actually evict a model between runs, look at a model-unloader node instead. For a quick VRAM readout and a tidy-up before the next big op, this one does the job in one node.
There's no separate dependency puzzle hiding here, which is more than you can say for the RTX upscaler in the same pack. If all you need is a memory gauge with a cleanup side effect, this is the most honest node in the suite.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| any_inputopt | * | — | |
| empty_cacheopt | BOOLEAN | true | — |
| gc_collectopt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| any_output | * | — |