64 lines
3.6 KiB
Plaintext
64 lines
3.6 KiB
Plaintext
|
|
# ==============================================================================
|
||
|
|
# GPTEdit Configuration File
|
||
|
|
# ==============================================================================
|
||
|
|
# Copy this file to .env and update with your settings
|
||
|
|
|
||
|
|
# ------------------------------------------------------------------------------
|
||
|
|
# OpenAI API Configuration (REQUIRED)
|
||
|
|
# ------------------------------------------------------------------------------
|
||
|
|
OPENAI_API_KEY=your-api-key-here # Required: Your OpenAI API key
|
||
|
|
|
||
|
|
# ------------------------------------------------------------------------------
|
||
|
|
# Server Configuration
|
||
|
|
# ------------------------------------------------------------------------------
|
||
|
|
LOG_LEVEL=INFO # Logging level: DEBUG, INFO, WARNING, ERROR
|
||
|
|
MAX_IMAGE_SIZE_MB=4 # Max image size before auto-optimization (MB)
|
||
|
|
DEFAULT_TIMEOUT=30 # API request timeout in seconds
|
||
|
|
|
||
|
|
# ------------------------------------------------------------------------------
|
||
|
|
# Directory Configuration
|
||
|
|
# ------------------------------------------------------------------------------
|
||
|
|
# Input directory for source images to edit
|
||
|
|
INPUT_PATH=./input_images # Default: ./input_images
|
||
|
|
# Place images here for edit_image_from_file
|
||
|
|
# to read and process
|
||
|
|
|
||
|
|
# Output directory for all generated images and files
|
||
|
|
GENERATED_IMAGES_PATH=./generated_images # Default: ./generated_images
|
||
|
|
# Structure:
|
||
|
|
# ├── {base_name}_000.png - Original input images
|
||
|
|
# ├── {base_name}_001.png - Edited output images
|
||
|
|
# └── {base_name}_001.json - JSON parameter files
|
||
|
|
|
||
|
|
# File naming configuration
|
||
|
|
OUTPUT_FILENAME_PREFIX=gptimage1 # Prefix for output files
|
||
|
|
# Example workflow:
|
||
|
|
# 1. Place image.jpg in INPUT_PATH
|
||
|
|
# 2. Call edit_image_from_file("image.jpg", "make it brighter")
|
||
|
|
# 3. Results in GENERATED_IMAGES_PATH:
|
||
|
|
# - gptimage1_20250824_143022_000.png (original)
|
||
|
|
# - gptimage1_20250824_143022_001.png (edited)
|
||
|
|
# - gptimage1_20250824_143022_001.json (parameters)
|
||
|
|
|
||
|
|
# Save options
|
||
|
|
SAVE_ORIGINALS=true # Copy input images to GENERATED_IMAGES_PATH as {base_name}_000.png
|
||
|
|
SAVE_PARAMETERS=true # Save edit parameters as JSON files
|
||
|
|
|
||
|
|
# ------------------------------------------------------------------------------
|
||
|
|
# Feature Flags
|
||
|
|
# ------------------------------------------------------------------------------
|
||
|
|
ENABLE_AUTO_MASK=false # Auto-generate masks (future feature)
|
||
|
|
ENABLE_AUTO_OPTIMIZE=true # Auto-convert large images to WebP
|
||
|
|
|
||
|
|
# ------------------------------------------------------------------------------
|
||
|
|
# Advanced Settings (Optional)
|
||
|
|
# ------------------------------------------------------------------------------
|
||
|
|
# WebP Optimization Settings
|
||
|
|
WEBP_QUALITY_MIN=60 # Minimum WebP quality (1-100)
|
||
|
|
WEBP_QUALITY_MAX=95 # Maximum WebP quality (1-100)
|
||
|
|
WEBP_METHOD=6 # WebP compression method (0-6, 6=best)
|
||
|
|
|
||
|
|
# Image Processing
|
||
|
|
AUTO_RESIZE_THRESHOLD=0.5 # Min scale factor when resizing (0.1-1.0)
|
||
|
|
PRESERVE_METADATA=false # Keep EXIF data in processed images
|