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
+4
View File
@@ -19,6 +19,10 @@ DB_PATH = DATA_DIR / "manager.db"
COMFYUI_PORT = os.environ.get("COMFYUI_PORT", "8188")
COMFYUIMINI_PORT = os.environ.get("COMFYUIMINI_PORT", "3000")
# Internal URL of the ComfyUI container (reachable over the docker network),
# used to proxy the "free memory / unload models" action.
COMFYUI_URL = os.environ.get("COMFYUI_URL", "http://comfyui:8188")
# Image file types shown in the gallery.
IMAGE_EXTS = {".png", ".jpg", ".jpeg", ".webp", ".gif", ".bmp"}