Files
facefusion-api/app/config.py

39 lines
1004 B
Python
Raw Normal View History

import json
from typing import List
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
model_config = {'env_prefix': 'FF_'}
# Paths
upload_dir: str = '/data/uploads'
output_dir: str = '/data/outputs'
models_dir: str = '/data/models'
temp_dir: str = '/data/temp'
jobs_dir: str = '/data/jobs'
# FaceFusion defaults
execution_providers: str = '["cpu"]'
execution_thread_count: int = 4
video_memory_strategy: str = 'moderate'
face_detector_model: str = 'yolo_face'
download_providers: str = '["github", "huggingface"]'
download_scope: str = 'lite'
log_level: str = 'info'
# Limits
max_upload_size_mb: int = 500
sync_timeout_seconds: int = 120
auto_cleanup_hours: int = 24
def get_execution_providers(self) -> List[str]:
return json.loads(self.execution_providers)
def get_download_providers(self) -> List[str]:
return json.loads(self.download_providers)
settings = Settings()