π Cache Stats
A window into a cache this pack never fills
- cache_stats
Cache Stats prints a one-glance readout of what's sitting in comfyui-memory-manager's internal model cache. Place it, run the queue, and it returns a few lines: how many models are cached, how much VRAM they're eating, and the per-model breakdown. It's the telemetry screen for the LRU cache idea the pack's README talks about.
Here's the part you need before you get excited: it will almost always say "Cached models: 0." That's not you doing it wrong, and I'll get to why in a minute.
What it actually shows
The node reads a global LRUModelCache instance the pack keeps in memory and formats it into a cache_stats STRING output:
Cached models: 2
Cache usage: 3.50GB / 6.0GB
- sdxl_base_1.0: 3495MB
- refiner: 1088MB
That second line - usage versus max - is the one that matters, because it's the same budget number that βοΈ Set Cache Size controls. If the cache ever filled up, this node is how you'd confirm the eviction logic was doing its job.
The dirty secret, straight from the source
I went and read the code, because this is exactly the kind of claim a README will happily oversell. The cache itself is a real, sensible little class: an OrderedDict with a byte budget, move_to_end for recency, and an eviction loop that pops the least-recently-used entry when you exceed the budget. Nice. Textbook LRU.
But nothing ever puts anything into it. In the entire pack, no node calls cache.put(), and there's no hook into ComfyUI's model loader - the comfy.model_management import in memory_manager.py is imported and never used. There's even an estimate_model_size() helper that's complete dead code. So the cache sits at zero entries forever, and Cache Stats faithfully reports that. It also only inspects this pack's private cache - not ComfyUI's own model cache. If ComfyUI has four checkpoints hot in VRAM, Cache Stats still shows 0, because those live in a totally different data structure.
Inputs and output
- Inputs: none. Not even a
trigger. It fires on every queue execution and samples whenever it happens to run. - Output:
cache_stats(STRING). To see it on the canvas, feed it into a text-display node or just read the value in the node's output. There's no image preview and nothing else to wire.
So the honest use is: pair it with Set Cache Size, run a workflow, and treat "0 cached models" as the baseline. If a future version of the pack actually wires the cache into ComfyUI's model loading, this is the node you'll check to see it working.
Installation
The whole pack installs the same way for all five of its nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/darshd9941/comfyui-memory-manager.git
cd comfyui-memory-manager
pip install -r requirements.txt # just torch>=2.0 - you already have it
Or skip the terminal entirely: in ComfyUI Manager, search for comfyui-memory-manager (titled "ComfyUI Memory Manager"), hit Install, restart. There are no model downloads and no heavy dependencies - the whole thing is ~150 lines of Python, which, given ComfyUI's malware history with one bad custom node, is honestly reassuring. You can read all of it in five minutes.
Troubleshooting
If your Cache Stats node shows "Cached models: 0" and you expected to see your loaded checkpoints listed - that's the design, not a bug, and this paragraph is the whole troubleshooting section. If it errors, check that the pack installed cleanly and that you restarted ComfyUI so the new nodes register. If you're trying to see real VRAM numbers instead, use the pack's π VRAM Monitor node, which reads actual torch.cuda stats rather than an empty dict.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| cache_stats | STRING | β |