The /macmem/stats route previously never read MLX and returned a cached
value populated only by the MacMemProbe node, so the "MLX Metal" bar stayed
hidden (display:none) until a probe ran in the graph.
Read MLX memory live in collect_stats() whenever the server is idle
(mlx_live or not _is_executing()), keeping the last good value during
execution. Reading MLX's memory counters (get_active/cache/peak_memory) is
a global per-process query that is safe from any thread — verified under
concurrent GPU compute — and gating the route read on "not executing"
ensures MLX is never touched while a prompt runs on the executor thread.
The Metal bar now appears automatically after any MLX/mflux activity.
MacMemProbe still works and is now optional (live updates during a run).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Real-time memory monitor for ComfyUI on Apple Silicon (MPS / unified memory):
floating panel (Unified RAM, MPS driver/active, MLX Metal, Swap, CPU, process
RSS, loaded models) with per-run peak markers, plus a Mac Memory Probe graph
node for inline snapshots. MLX memory is read only from the execution thread
for thread-safety. Includes an mflux AnyModel example workflow.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>