- anything
- output
This is the less-famous sibling of VRAM-Cleanup, and it's aimed at a different problem. VRAM-Cleanup frees your GPU. RAM-Cleanup frees your system memory - the ordinary RAM that slowly creeps up over a long ComfyUI session until the machine feels sluggish or you're one big model load away from a freeze. If your out-of-memory errors are on the GPU, you want the other node. If your box just gets heavier the longer ComfyUI stays open, this is the one.
Why you'd reach for it
Here's the honest framing: most memory pain in image and video generation is VRAM, not RAM, so RAM-Cleanup is the more niche of the two nodes in this pack. But it does have a real use. When ComfyUI offloads models to system RAM, caches file data from multi-gigabyte checkpoints, and generally runs for hours, the memory it grabs doesn't always come back cleanly. The README's own advice is to fire this after heavy workflows to head off memory creep over long runs - not to sprinkle it on every generation.
How it works
Four switches, three of them boolean and on by default, plus a retry counter:
- clean_file_cache - drops cached file data the OS is holding from loading big models.
- clean_processes - trims the process's working-set memory back down.
- clean_dlls - unloads unused DLLs. This is a Windows concept; the README says the node supports Windows and Linux, but Linux has no DLLs, so on Linux this toggle simply has nothing to do. Not a bug - just don't expect it to matter off Windows.
- retry_times - how many attempts it makes (1–10, default 3). Reclaiming RAM isn't always granted on the first ask, so it can retry.
Like its sibling, it also has an anything input (type *) and a matching output, and it's an output node. Same rule applies: wire the thing you want done into anything and continue from output, so the cleanup runs at the point in execution you actually meant rather than whenever.
Installing it
Through ComfyUI Manager: search the pack title Comfyui-Memory_Cleanup, install, restart. The node lives under the Memory Management category alongside VRAM-Cleanup.
Manual, straight from the README:
cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/Comfyui-Memory_Cleanup.git
pip install -r requirements.txt
Restart ComfyUI afterward. Do run the pip step - there's a requirements.txt. No models to download.
Common issues
- "clean_dlls does nothing for me." If you're on Linux or Mac, correct - it's Windows-only by nature. Leave it on or off, it won't change anything.
- The effect can feel small, and that's normal. Modern operating systems manage RAM aggressively on their own, so forcibly reclaiming it sometimes buys less than you'd hope. The clearest win is on long Windows sessions where things have genuinely bloated.
- Dropping file cache has a price. The README notes cleanup can nick performance slightly - that's the OS having to re-read from disk next time it needs those files. Fine after a heavy run; wasteful between every quick generation.
- This is a RAM tool, not a VRAM tool. If your errors say CUDA out of memory, RAM-Cleanup won't touch them - reach for VRAM-Cleanup instead. And like any custom node, it's arbitrary Python with full OS access, which is the reason for the pip install step; it's a small utility, so the risk is low.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| clean_file_cache | BOOLEAN | true | — |
| clean_processes | BOOLEAN | true | — |
| clean_dlls | BOOLEAN | true | — |
| retry_times | INT | 31–10 | — |
| anythingopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |