feat: add StabilityMatrix-style Model Manager service

New FastAPI container (port 8189) to download and manage models:
- Installed Models, Add/Download (CivitAI/HuggingFace/direct URL), Settings views
- Persistent SQLite storage for API keys and download history (./sparkyui-data)
- Downloads land in ./models, auto-sorted into ComfyUI's standard subfolders
- Default COMFYUI_HOST_PATH and SPARKYUI_DATA_PATH to the project root
- Wire docker-compose service, env defaults, gitignore, README docs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 06:19:44 -04:00
parent 6fa6c5041b
commit 359043ad67
17 changed files with 1355 additions and 16 deletions
+47 -4
View File
@@ -26,6 +26,7 @@ Standard ComfyUI containers and PyTorch wheels don't support sm_121. SparkyUI so
- **ComfyUI** (latest master branch)
- **ComfyUI-Manager** - auto-installed on first run for easy custom node management
- **ComfyUIMini** - mobile-friendly web UI for phones/tablets (separate container)
- **Model Manager** - StabilityMatrix-style UI to download/manage models (separate container)
- **SageAttention** - compiled natively for sm_121 (Blackwell tensor cores)
- **PyTorch 2.9.1+cu130** - ARM64 wheels with CUDA 13.0 support
@@ -77,6 +78,7 @@ docker compose logs -f
**Access:**
- **ComfyUI (Desktop):** http://localhost:8188
- **ComfyUIMini (Mobile):** http://localhost:3000
- **Model Manager:** http://localhost:8189
## Requirements
@@ -91,17 +93,28 @@ docker compose logs -f
Copy `.env.example` to `.env` and edit:
```bash
# Path to your existing ComfyUI models (mounted read-only)
COMFYUI_HOST_PATH=/path/to/your/ComfyUI
# Base path holding the models/ directory (defaults to the project root).
# The Model Manager downloads into <COMFYUI_HOST_PATH>/models; ComfyUI reads it.
COMFYUI_HOST_PATH=.
# Path for SparkyUI data (custom_nodes, outputs, inputs)
SPARKYUI_DATA_PATH=/path/to/SparkyUI
# Path for SparkyUI data (custom_nodes, outputs, inputs, manager DB).
# Defaults to the project root.
SPARKYUI_DATA_PATH=.
# Ports
COMFYUI_PORT=8188
COMFYUIMINI_PORT=3000
MODEL_MANAGER_PORT=8189
# Optional: pin to specific versions
COMFYUI_REF=master
SAGEATTN_REF=main
```
Both paths default to the project root, so out of the box models are stored in
`./models` and the Model Manager's database in `./sparkyui-data`. Point
`COMFYUI_HOST_PATH` at an existing ComfyUI install if you'd rather reuse its models.
## Architecture
```
@@ -214,6 +227,36 @@ docker compose build comfyuimini
docker compose up -d comfyuimini
```
## Model Manager
SparkyUI includes a **StabilityMatrix-style Model Manager** - a lightweight FastAPI web app
(separate container) for downloading and managing models without touching the command line.
**Access:** `http://<your-dgx-ip>:8189`
**Features:**
- **Installed Models** - browse what's on disk, grouped by type, with size and delete actions
- **Add / Download** - paste a download URL and pick a type; live progress bars
- **Direct URLs** - any direct download link
- **CivitAI** - paste a model page link (`civitai.com/models/...`) or an
`api/download/models/...` link; the type and filename are auto-detected
- **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)
**How it works:**
- Runs as a FastAPI server in its own container (`python:3.12-slim`)
- Downloads land in the shared `models/` folder, sorted into ComfyUI's standard sub-folders
by type (`checkpoints/`, `loras/`, `vae/`, `controlnet/`, `upscale_models/`, …) - these are
created automatically on first start
- ComfyUI mounts the same `models/` folder read-only, so new downloads appear in its loaders
**Build only the Model Manager** (if the rest is already built):
```bash
docker compose build model-manager
docker compose up -d model-manager
```
## SageAttention Notes
SageAttention PR #297 added sm_121 support but was merged then reverted due to stability issues. Our approach: