Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
51 lines
1.5 KiB
Python
51 lines
1.5 KiB
Python
"""Dependency-light typed values crossing the product/engine boundary."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from enum import StrEnum
|
|
from pathlib import Path
|
|
from typing import Any, Mapping
|
|
|
|
|
|
class GenerationMode(StrEnum):
|
|
TEXT_TO_VIDEO = "t2v"
|
|
IMAGE_TO_VIDEO = "i2v"
|
|
|
|
|
|
@dataclass(frozen=True, slots=True)
|
|
class GenerationRequest:
|
|
prompt: str
|
|
mode: GenerationMode
|
|
model: str
|
|
output_path: Path
|
|
width: int
|
|
height: int
|
|
duration_seconds: int
|
|
correlation_id: str
|
|
reference_image_path: Path | None = None
|
|
seed: int | None = None
|
|
parameters: Mapping[str, Any] = field(default_factory=dict)
|
|
|
|
def __post_init__(self) -> None:
|
|
if not self.prompt.strip():
|
|
raise ValueError("generation prompt must not be empty")
|
|
if not self.model.strip():
|
|
raise ValueError("generation model must not be empty")
|
|
if self.width <= 0 or self.height <= 0:
|
|
raise ValueError("generation dimensions must be positive")
|
|
if not 1 <= self.duration_seconds <= 30:
|
|
raise ValueError("generation duration must be between 1 and 30 seconds")
|
|
if self.mode is GenerationMode.IMAGE_TO_VIDEO and self.reference_image_path is None:
|
|
raise ValueError("image-to-video requires a local reference image")
|
|
|
|
|
|
@dataclass(frozen=True, slots=True)
|
|
class GenerationResult:
|
|
output_path: Path
|
|
duration_seconds: float
|
|
provider_run_id: str
|
|
model: str
|
|
correlation_id: str
|
|
metadata: Mapping[str, Any] = field(default_factory=dict)
|