2d50679ec0
- FastAPI with job polling: POST /generate, GET /jobs/{id}, /download, /health
- SQLite job persistence (aiosqlite), background task processing
- LTX-2.3 DistilledPipeline via native ltx-pipelines (editable install from submodule)
- Configurable model paths, LoRA support, FP8 quantization via env vars
- Single-concurrency GPU lock for safe inference
- LTX-2 as git submodule under libs/
43 lines
1.1 KiB
Python
43 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
import os
|
|
from typing import Optional
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
app_name: str = "Revids"
|
|
host: str = "0.0.0.0"
|
|
port: int = 8000
|
|
reload: bool = True
|
|
|
|
# LTX-2.3 model paths (update after downloading models)
|
|
ltx_distilled_checkpoint: str = "models/ltx-2.3-22b-distilled-1.1.safetensors"
|
|
ltx_gemma_root: str = "models/gpt-4o-5805-ava-gguf-model"
|
|
ltx_spatial_upsampler: str | None = None
|
|
ltx_device: str = "cuda"
|
|
ltx_quantization: str = "fp8_cast"
|
|
|
|
# LoRA paths (list of "path:scale" strings, env: REVIDS_LTX_LORAS="models/my-lora.safetensors:1.0")
|
|
ltx_loras: list[str] = []
|
|
|
|
video_output_dir: str = os.path.join(os.path.dirname(os.path.dirname(__file__)), "videos")
|
|
|
|
# DB
|
|
db_path: str = os.path.join(os.path.dirname(__file__), "jobs.db")
|
|
|
|
# Generation defaults
|
|
default_frames: int = 65
|
|
default_fps: float = 24.0
|
|
default_width: int = 768
|
|
default_height: int = 512
|
|
|
|
# Concurrency
|
|
max_concurrent_jobs: int = 1
|
|
|
|
model_config = {"env_prefix": "REVIDS_", "env_file": ".env"}
|
|
|
|
|
|
settings = Settings()
|