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
+45 -8
View File
@@ -50,20 +50,21 @@ services:
CUDA_CACHE_MAXSIZE: "4294967296"
volumes:
# Models from existing ComfyUI install (read-only)
- ${COMFYUI_HOST_PATH}/models:/opt/ComfyUI/models:ro
# Models from existing ComfyUI install (read-only).
# Defaults to the project root; the model-manager service writes here.
- ${COMFYUI_HOST_PATH:-.}/models:/opt/ComfyUI/models:ro
# Custom nodes - comment out to use container-only (fresh) custom_nodes
# If mounted, ComfyUI-Manager installs persist across container restarts
- ${SPARKYUI_DATA_PATH}/custom_nodes:/opt/ComfyUI/custom_nodes
- ${SPARKYUI_DATA_PATH:-.}/custom_nodes:/opt/ComfyUI/custom_nodes
# Outputs/inputs/workflows - persistent across restarts
- ${SPARKYUI_DATA_PATH}/output:/opt/ComfyUI/output
- ${SPARKYUI_DATA_PATH}/input:/opt/ComfyUI/input
- ${SPARKYUI_DATA_PATH}/workflows:/opt/ComfyUI/workflows
- ${SPARKYUI_DATA_PATH:-.}/output:/opt/ComfyUI/output
- ${SPARKYUI_DATA_PATH:-.}/input:/opt/ComfyUI/input
- ${SPARKYUI_DATA_PATH:-.}/workflows:/opt/ComfyUI/workflows
# Wheel cache (optional - for prebuilt wheels)
- ${SPARKYUI_DATA_PATH}/wheels:/opt/wheels
- ${SPARKYUI_DATA_PATH:-.}/wheels:/opt/wheels
# Sparky patches - Grace-Blackwell unified memory optimizations
# model_management.py: HIGH_VRAM→NORMAL_VRAM, intermediate_device()→cuda, soft_empty_cache skip,
@@ -114,7 +115,7 @@ services:
volumes:
# Share output directory with ComfyUI for gallery feature (read-only)
- ${SPARKYUI_DATA_PATH}/output:/shared/output:ro
- ${SPARKYUI_DATA_PATH:-.}/output:/shared/output:ro
# Persist server-side workflows
- comfyuimini_workflows:/app/workflows
@@ -127,6 +128,42 @@ services:
restart: unless-stopped
# Model Manager - StabilityMatrix-style model download/management UI
# Access at http://<host>:8189
model-manager:
build:
context: ./model-manager
dockerfile: Dockerfile
image: sparkyui-model-manager:latest
container_name: model-manager
ports:
- "${MODEL_MANAGER_PORT:-8189}:8189"
environment:
MODELS_DIR: /models
DATA_DIR: /data
volumes:
# Shared models dir - read-WRITE here so downloads land on the host.
# ComfyUI mounts the same host folder read-only and picks up new files.
- ${COMFYUI_HOST_PATH:-.}/models:/models
# Persistent SQLite DB (sources, API keys, download history)
- ${SPARKYUI_DATA_PATH:-.}/sparkyui-data:/data
networks:
- sparky_net
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8189/api/model-types"]
interval: 30s
timeout: 10s
start_period: 15s
retries: 3
restart: unless-stopped
networks:
sparky_net:
driver: bridge