# services/comfy-agent/app/config.py
from pydantic_settings import BaseSettings

class Settings(BaseSettings):
    SERVICE_NAME: str = "comfy-agent"
    API_HOST: str = "0.0.0.0"
    API_PORT: int = 8880

    COMFYUI_HTTP: str = "http://127.0.0.1:8188"
    COMFYUI_WS: str = "ws://127.0.0.1:8188/ws"

    NATS_URL: str = "nats://144.76.224.179:4222"  # NODE1 production IP
    NATS_SUBJECT_INVOKE: str = "agent.invoke.comfy"
    NATS_SUBJECT_IMAGE: str = "comfy.request.image"
    NATS_SUBJECT_VIDEO: str = "comfy.request.video"

    STORAGE_PATH: str = "/data/comfy-results"
    PUBLIC_BASE_URL: str = "http://212.8.58.133:8880/files"  # NODE3 IP
    S3_ENDPOINT: str = ""
    S3_BUCKET: str = ""
    S3_ACCESS_KEY: str = ""
    S3_SECRET_KEY: str = ""
    S3_REGION: str = "us-east-1"
    S3_SECURE: bool = False
    S3_URL_TTL_S: int = 900
    S3_PREFIX: str = "comfy-results"
    S3_FORCE_PATH_STYLE: bool = True
    MINIO_ENDPOINT: str = ""
    MINIO_BUCKET: str = ""
    MINIO_ACCESS_KEY: str = ""
    MINIO_SECRET_KEY: str = ""
    LTX_CKPT_NAME: str = "ltx-2-19b-distilled-fp8.safetensors"
    LTX_TEXT_ENCODER: str = ""
    LTX_DEVICE: str = "default"
    LTX_SAMPLER: str = "euler"
    LTX_MAX_SHIFT: float = 2.05
    LTX_BASE_SHIFT: float = 0.95
    LTX_TERMINAL: float = 0.1
    LTX_STRETCH: bool = True

    MAX_CONCURRENCY: int = 1  # для LTX-2 стартово краще 1
    IDEMPOTENCY_TTL_S: int = 24 * 60 * 60
    IDEMPOTENCY_DB_PATH: str = ""

settings = Settings()
