File size: 3,060 Bytes
b65dc99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# BackgroundFX Pro Docker Environment Configuration
# Copy this file to .env and customize for your deployment

# ============================================================================
# Application Settings
# ============================================================================

# Gradio UI Settings
GRADIO_SERVER_NAME=0.0.0.0
GRADIO_SERVER_PORT=7860
GRADIO_ROOT_PATH=/
GRADIO_SHARE=false

# API Settings
API_HOST=0.0.0.0
API_PORT=8000
API_WORKERS=4

# Device Configuration
DEVICE=auto  # auto, cuda, cpu
CUDA_VISIBLE_DEVICES=0
NVIDIA_VISIBLE_DEVICES=0

# ============================================================================
# Model Settings
# ============================================================================

MODEL_CACHE_DIR=/app/models
TORCH_HOME=/app/models/.cache
HF_HOME=/app/models/huggingface
DOWNLOAD_MODELS_ON_START=true

# Model selection
DEFAULT_SEGMENTATION_MODEL=rmbg-1.4
DEFAULT_MATTING_MODEL=modnet
ENABLE_TWO_STAGE=true

# ============================================================================
# Performance Settings
# ============================================================================

# Memory limits
MAX_MEMORY_GB=12
MAX_GPU_MEMORY_GB=8
MEMORY_CLEANUP_INTERVAL=100

# Processing settings
BATCH_SIZE=1
MAX_WORKERS=4
FRAME_SKIP=1
QUALITY_PRESET=high

# Cache settings
ENABLE_CACHE=true
CACHE_SIZE_MB=500
CACHE_TTL=3600

# ============================================================================
# Storage Settings
# ============================================================================

UPLOAD_DIR=/app/uploads
OUTPUT_DIR=/app/outputs
TEMP_DIR=/tmp/processing
LOG_DIR=/app/logs

# Size limits
MAX_UPLOAD_SIZE_MB=500
MAX_VIDEO_DURATION_SECONDS=600

# ============================================================================
# Redis Settings (for distributed deployment)
# ============================================================================

REDIS_ENABLED=true
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_DB=0
REDIS_PASSWORD=

# ============================================================================
# Security Settings
# ============================================================================

# Authentication
ENABLE_AUTH=false
AUTH_SECRET_KEY=change-this-secret-key-in-production
AUTH_ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30

# CORS
CORS_ORIGINS=*
CORS_ALLOW_CREDENTIALS=true

# Rate limiting
RATE_LIMIT_ENABLED=true
RATE_LIMIT_REQUESTS=100
RATE_LIMIT_WINDOW_SECONDS=60

# ============================================================================
# Monitoring Settings
# ============================================================================

# Logging
LOG_LEVEL=INFO
LOG_FORMAT=json
ENABLE_ACCESS_LOG=true

# Metrics
ENABLE_METRICS=true
METRICS_PORT=9091

# Health checks
HEALTH_CHECK_PATH=/health
HEALTH_CHECK_INTERVAL=30

# ============================================================================
# Development Settings
# ============================================================================

DEBUG=false
RELOAD=false
PROFILE=false