feat: Add Comfy Agent service for NODE3 image/video generation

- Create comfy-agent service with FastAPI + NATS integration
- ComfyUI client with HTTP/WebSocket support
- REST API: /generate/image, /generate/video, /status, /result
- NATS subjects: agent.invoke.comfy, comfy.request.*
- Async job queue with progress tracking
- Docker compose configuration for NODE3
- Update PROJECT-MASTER-INDEX.md with NODE2/NODE3 docs

Co-Authored-By: Warp <agent@warp.dev>
This commit is contained in:
Apple
2026-02-10 04:13:49 -08:00
parent 6e0887abcd
commit c41c68dc08
16 changed files with 815 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
# services/comfy-agent/app/storage.py
import os
from pathlib import Path
from .config import settings
def ensure_storage() -> None:
Path(settings.STORAGE_PATH).mkdir(parents=True, exist_ok=True)
def make_job_dir(job_id: str) -> str:
ensure_storage()
d = os.path.join(settings.STORAGE_PATH, job_id)
Path(d).mkdir(parents=True, exist_ok=True)
return d
def public_url(job_id: str, filename: str) -> str:
return f"{settings.PUBLIC_BASE_URL}/{job_id}/{filename}"