32 lines
721 B
Python
32 lines
721 B
Python
import json
|
|
from pydantic import BaseModel, ValidationError
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
from typing import List
|
|
|
|
|
|
class ComfyUIServer(BaseModel):
|
|
"""定义单个ComfyUI服务器的配置模型。"""
|
|
|
|
http_url: str
|
|
ws_url: str
|
|
input_dir: str
|
|
output_dir: str
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""
|
|
应用配置类,通过.env文件加载环境变量。
|
|
"""
|
|
|
|
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
|
|
|
|
DB_FILE: str = "/db/workflows_service.sqlite"
|
|
# S3 和 AWS 配置保持不变
|
|
S3_BUCKET_NAME: str
|
|
AWS_ACCESS_KEY_ID: str
|
|
AWS_SECRET_ACCESS_KEY: str
|
|
AWS_REGION_NAME: str
|
|
|
|
|
|
settings = Settings()
|