feat(model-manager): "Free GPU memory" button to unload ComfyUI models

ComfyUI caches the last model when RAM is plentiful (unified memory), so
memory doesn't drop after switching models even though models are being
swapped, not accumulated. Add a sidebar "Free GPU memory" button that
proxies ComfyUI's POST /free (unload_models + free_memory) via a new
/api/comfyui/free endpoint (COMFYUI_URL env). Verified it releases ~7GB.
README documents this plus the --disable-smart-memory auto-unload option.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 17:14:37 -04:00
parent c2b0f202bf
commit 399acabd58
7 changed files with 53 additions and 1 deletions
+5
View File
@@ -256,6 +256,11 @@ SparkyUI includes a **StabilityMatrix-style Model Manager** - a lightweight Fast
- **HuggingFace** - paste a `resolve` URL (works with gated repos via your token)
- **Settings** - store your **CivitAI API key** and **HuggingFace token** persistently
(saved to a SQLite DB under `./sparkyui-data`, never committed to git)
- **Free GPU memory** - a sidebar button that unloads all models from ComfyUI and releases
memory (proxies ComfyUI's `/free`). ComfyUI keeps the last model cached for fast reuse when
RAM is plentiful, so memory won't drop on its own after switching models - use this to
release it on demand. (For automatic unload after every generation, add
`--disable-smart-memory` to `COMFYUI_FLAGS`, at the cost of reloading each run.)
**How it works:**
- Runs as a FastAPI server in its own container (`python:3.12-slim`)