🧹 Memory Manager (GGUF)
The node that un-wedges your VRAM when a loaded GGUF model won't let go
- trigger
- status
Here's a scenario anyone running local LLMs knows: you generate, switch models, and suddenly your 12 GB card is showing 11 GB "used" by a model you're not even using anymore. ComfyUI's garbage collector doesn't always know an inference engine is holding weights, and llama-cpp models are greedy about memory they've been given. The Memory Manager node exists because the pack's own issue tracker hit exactly this: VRAM not being freed between runs. It's the cleanup crew for the ComfyUI-GGUF-VLM pack.
How it works
It's a single-purpose node with one meaningful input - action - and four options:
- Clear All Models - unloads every model the pack's inference engine currently holds, listing each one as it goes.
- Force GC - fires Python's garbage collector and tells you how many objects it collected.
- Clear GPU Cache - runs
torch.cuda.empty_cache(), and it's unusually honest about the result: it reports VRAM allocated and reserved before and after, so you can see the actual GB freed instead of guessing. - Full Cleanup - all of the above in one pass. The default, and the one you'll reach for.
There's also an optional trigger input that accepts any connection - wire the output of a generation node into it to force a cleanup as part of a workflow's sequencing. The node returns a status string summarizing what it did.
Why you'll actually use it
Two situations. First, the obvious one: you're running a big Qwen GGUF, you want to switch to a different model or run a memory-hungry image gen, and the old weights won't release. A Full Cleanup pass is the difference between an OOM crash and a clean restart of the next node.
Second, the sneaky one: the pack's changelog notes that certain llama-cpp-python builds on Windows can throw blue screens when memory pressure gets out of hand. Regularly flushing VRAM between heavy runs keeps you on the boring side of that line. It's not a magic bullet - it can only free what the pack's own engine is holding, not arbitrary VRAM hogged by other custom nodes - but within its lane it does exactly what it says.
Setup
No dependencies beyond the pack itself (you need torch, which ComfyUI already provides). Install once:
cd ComfyUI/custom_nodes
git clone https://github.com/walke2019/ComfyUI-GGUF-VLM.git
cd ComfyUI-GGUF-VLM
pip install -r requirements.txt
If you see a "CUDA not available, skipping GPU cache clear" message in the status, that's just the node telling you your llama-cpp build isn't on CUDA - the VRAM-clearing half does nothing for a CPU-only setup, which is fine. The real frustration with this node is mild: it's an output node, so it shows up as a terminal point in your workflow, which means you'll want it dangling at the end of the graph rather than mid-line.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| action | COMBO | Full Cleanup | 选择清理操作 |
| triggeropt | * | 连接任意输出以触发清理(可选) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| status | STRING | — |