feat: add environment variable configuration for server settings
Configurable via: - UPSCALE_PORT (default: 7860) - UPSCALE_HOST (default: 0.0.0.0) - UPSCALE_SHARE (default: false) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""Configuration settings for Real-ESRGAN Web UI."""
|
||||
|
||||
import os
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
@@ -162,10 +163,10 @@ VIDEO_CODECS: dict[str, VideoCodecConfig] = {
|
||||
class AppConfig:
|
||||
"""Main application configuration."""
|
||||
|
||||
# Server settings
|
||||
server_name: str = "0.0.0.0"
|
||||
server_port: int = 7860
|
||||
share: bool = False
|
||||
# Server settings (configurable via environment variables)
|
||||
server_name: str = os.getenv("UPSCALE_HOST", "0.0.0.0")
|
||||
server_port: int = int(os.getenv("UPSCALE_PORT", "7860"))
|
||||
share: bool = os.getenv("UPSCALE_SHARE", "").lower() in ("true", "1", "yes")
|
||||
|
||||
# Queue settings
|
||||
max_queue_size: int = 20
|
||||
|
||||
Reference in New Issue
Block a user