Files
microdao-daarion/services/comfy-agent/app/models.py
Apple c41c68dc08 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>
2026-02-10 04:13:49 -08:00

35 lines
1.1 KiB
Python

# services/comfy-agent/app/models.py
from pydantic import BaseModel, Field
from typing import Any, Dict, Optional, Literal
GenType = Literal["text-to-image", "text-to-video", "image-to-video"]
class GenerateImageRequest(BaseModel):
prompt: str = Field(min_length=1)
negative_prompt: Optional[str] = None
width: int = 1024
height: int = 1024
steps: int = 28
seed: Optional[int] = None
workflow: Optional[str] = None
workflow_params: Dict[str, Any] = Field(default_factory=dict)
class GenerateVideoRequest(BaseModel):
prompt: str = Field(min_length=1)
seconds: int = 4
fps: int = 24
steps: int = 30
seed: Optional[int] = None
workflow: Optional[str] = None
workflow_params: Dict[str, Any] = Field(default_factory=dict)
class JobStatus(BaseModel):
job_id: str
type: GenType
status: Literal["queued", "running", "succeeded", "failed"]
progress: float = 0.0
message: Optional[str] = None
result_url: Optional[str] = None
error: Optional[str] = None
comfy_prompt_id: Optional[str] = None