Zoey - 系统监控
A node that watches your VRAM and cleans up after itself while you generate
- passthrough
- passthrough
- stats_json
ZoeySystemMonitor is the node that runs your graph's resource monitor and its janitor at once. Drop it into a workflow and it reports live CPU/RAM/VRAM/GPU stats in a dashboard panel while ComfyUI is running - and, here's the part that makes it different from every task-manager-in-a-browser tool: it automatically cleans up VRAM when your process's torch allocation crosses a threshold you set. ComfyUI already does lazy VRAM management between steps; this node is for when you want to force it - long video renders, multiple models chained in one graph, or the general "I've been sampling for six hours and want to know if I'm about to OOM" anxiety.
It's from comfyui-ZoeyTool (Zoey Tool/系统工具), and it reads like the author's own operational dashboard - one person who got tired of alt-tabbing to nvidia-smi.
How it works
Two things run in parallel. First, an embedded HTTP server starts on 127.0.0.1:18888 the moment the pack loads, serving a GET /stats JSON endpoint (and a /cleanup force-clean endpoint), with a background thread collecting stats every second. Second, the node itself: give it a threshold (percent VRAM, default 85) and an aggressive toggle, and whenever your torch process's allocated VRAM hits the threshold - measured in the background or when the node runs - it fires a cleanup: gc.collect(), torch.cuda.empty_cache(), ComfyUI's soft_empty_cache(), and with aggressive on, cleanup_models() and a full CUDA sync (the "kicked in the teeth" level of free, which reloads models lazily on next use).
What it reports, when present: CPU % and RAM (via psutil - optional), VRAM used/total/percent, and GPU temperature + utilization (via nvidia-smi, so NVIDIA-only for those two fields). If psutil or nvidia-smi is missing, those fields just don't show rather than erroring.
The node is also a pass-through, which is its clever workflow trick:
passthroughinput (any type) →passthroughoutput: wire anything - a model, an image, a conditioning - through the node and it comes out the other side untouched, so the monitor rides along in your graph without breaking the flow.stats_jsonoutput - a JSON string of the current snapshot you can log, display, or feed to another node.
It's marked as an output node, and its own frontend panel renders the live dashboard.
Installing it
comfyui-ZoeyTool as usual:
cd ComfyUI/custom_nodes
git clone https://github.com/liangzoey/comfyui-ZoeyTool.git
cd comfyui-ZoeyTool
pip install -r requirements.txt
Restart ComfyUI (or ComfyUI Manager → comfyui-ZoeyTool). For the fullest stats, make sure psutil is present (the pack's requirements don't list it, so you may need pip install psutil yourself) - without it you lose CPU/RAM numbers but VRAM still works.
Where people get burned
The big one: this node actively frees memory in the background once your allocation crosses the threshold, and it does it from its own thread, not just when the node executes. If you set a low threshold (say 40%) while running a workflow that legitimately needs 70% of VRAM, expect models to get evicted mid-run and slow reloads on every step - that's the cleanup working as configured, not a bug. Leave it at the default 85 unless you know why you're lowering it. Second, aggressive mode calls cleanup_models() which unloads all cached models; on a big graph that's a costly next-step reload. Third, GPU temp/util only appear if nvidia-smi is on PATH - on AMD/ROCm or stripped-down systems those fields silently vanish. And if port 18888 is taken, the HTTP dashboard just won't start (it prints the failure to the console), though the node's own panel still works.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| threshold | FLOAT | 8510–99 | — |
| aggressive | BOOLEAN | false | — |
| passthroughopt | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| passthrough | * | — |
| stats_json | STRING | — |