🧹 Cleaner
The two-switch node that flushes VRAM and unloads models so the next one doesn't OOM
- anything
- output
The sequence is always the same: your workflow runs fine for two images, and on the third the sampler dies with a CUDA out-of-memory. Somewhere between the second and third pass, ComfyUI's model management stopped keeping up. FiL Neuro Cleaner is the node you drop in to fix exactly that - it's two switches, each doing precisely what its label says, with a passthrough socket so you can insert it anywhere in a chain.
It ships in the FiL Design ImageMind pack, and it's as close to a "just make it work" node as the pack gets: no models, no provider, no config. Just memory hygiene.
How it works
Two switches, and the names are the whole documentation:
clean_vram(default on) - flushes the GPU cache. Under the hood that's a garbage-collect plus ComfyUI'ssoft_empty_cache, which returns cached allocator blocks to the driver while leaving loaded models alone. This is the gentle one.unload_models(default on) - unloads every model ComfyUI currently holds. The next run reloads whatever it needs, which costs a few seconds of load time, but it's the difference between "the next node fits" and "the next node OOMs."
The anything input and output output are a passthrough - whatever comes in goes straight back out. That's the trick that makes the node usable: it doesn't have to sit at the end of your graph, it can sit in the middle of a chain, so the flush happens at exactly the point you need it. Put it between a big generation and a big upscale, and it cleans up the first before the second needs the memory.
Two details from the implementation worth knowing. First, the node is registered as an output node and uses a timestamp fingerprint, so it actually re-runs when you flip a switch - it doesn't get cached into doing nothing. Second, and this is a genuinely honest design decision: unloading used to be selective - four switches letting you unload only diffusion, or only CLIP, or only VAE, or only ControlNet. The author killed that. Sorting ComfyUI's loaded models by matching class names turned out to be unreliable - a model's nested submodules matched as one string, and the wrapper around every model counted as a diffusion marker, so "unload only the CLIP" quietly unloaded everything. All-or-nothing is the version that actually works.
When to use it
Two real cases. The first: a graph that spikes - heavy models, big batches - where you've learned the third pass dies and you want the cleanup before it does. Insert the cleaner at the right point and the failure just stops. The second: when you're swapping between checkpoints or mixing huge models and you want a fresh slate before the next load, so ComfyUI isn't holding yesterday's 12GB model in VRAM.
The honest counter-case: if your workflow fits comfortably, don't add it. unload_models costs reload time on every run, and if you don't need the memory you're just slowing yourself down. Reach for it when the OOM is real, not preemptively.
Installing it
Part of FiL Design ImageMind (MIT). ComfyUI Manager: search FiL_Design_ImageMind, or:
cd ComfyUI/custom_nodes
git clone https://github.com/FiL-Design-Ai/FiL_LLM FiL_Design_ImageMind
pip install -r FiL_Design_ImageMind/requirements.txt
Restart; it's under 🎨 FiL Design/Tools. ComfyUI 0.3.60+, Python 3.10+, and the pack's light dependencies - nothing extra to download.
Gotchas
The subtle one is that clean_vram and unload_models used to be more entangled than they look: the cache flush once also triggered an unload, so both switches did the same job by different routes. That's fixed in current versions - they're genuinely independent now - but it's worth knowing if you're debugging an old saved workflow. And if you wired this into a workflow you saved in an earlier version, an old unload_diffusion value maps positionally onto today's unload_models; a saved API-format prompt just falls back to defaults. Nothing breaks, but a stale value can mean models unload when you expected them to stay.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| clean_vram | BOOLEAN | true | 🧹 Flush GPU Cache |
| unload_models | BOOLEAN | true | 🧠 Unload Models |
| anythingopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | Passthrough output (same as input). |