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:
16
services/comfy-agent/app/storage.py
Normal file
16
services/comfy-agent/app/storage.py
Normal 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}"
|
||||
Reference in New Issue
Block a user