bd0cd4f9ff
- Remove unused imports (typing.Optional in config.py, uuid in models.py) - Fix fp8_scaled_mm to use build_policy(checkpoint_path) - Add .env.example with all configuration options
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
from __future__ import annotations
|
|
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
# --- Request ---
|
|
|
|
class GenerateRequest(BaseModel):
|
|
prompt: Optional[str] = Field(None, description="Optional text prompt to guide generation")
|
|
width: int = Field(768, ge=256, le=2048, multiple_of=32, description="Video width (must be divisible by 32)")
|
|
height: int = Field(512, ge=256, le=2048, multiple_of=32, description="Video height (must be divisible by 32)")
|
|
num_frames: int = Field(65, ge=9, le=257, description="Frame count (must be 8n+1)")
|
|
fps: float = Field(24.0, gt=0, le=60, description="Frames per second")
|
|
seed: Optional[int] = Field(None, description="Random seed for reproducibility")
|
|
|
|
|
|
# --- Job Status ---
|
|
|
|
class JobStatusResponse(BaseModel):
|
|
job_id: str
|
|
status: str # pending, processing, completed, failed
|
|
prompt: Optional[str] = None
|
|
params: Optional[dict] = None
|
|
error: Optional[str] = None
|
|
created_at: Optional[str] = None
|
|
completed_at: Optional[str] = None
|
|
|
|
|
|
# --- Submission Response ---
|
|
|
|
class JobSubmitResponse(BaseModel):
|
|
job_id: str
|
|
status: str = "pending"
|
|
message: str = "Job submitted. Poll GET /jobs/{job_id} for status."
|
|
|
|
|
|
# --- Error ---
|
|
|
|
class ErrorResponse(BaseModel):
|
|
error: str
|