import os from dotenv import load_dotenv # Load environment variables from .env file load_dotenv() # Hugging Face API token # First try to get from environment variables (Hugging Face Spaces secrets) # Then fall back to .env file for local development HF_TOKEN = os.getenv("HF_TOKEN", "") # Default model for text to image DEFAULT_TEXT2IMG_MODEL = "stabilityai/stable-diffusion-3-medium-diffusers" # Default model for image to image DEFAULT_IMG2IMG_MODEL = "stable-diffusion-v1-5/stable-diffusion-v1-5" # ControlNet configuration USE_CONTROLNET = True # Set to False to disable ControlNet in case of issues CONTROLNET_MODEL = "lllyasviel/sd-controlnet-depth" BASE_MODEL = "stable-diffusion-v1-5/stable-diffusion-v1-5" # Default prompts - used as placeholders in UI and defaults in API DEFAULT_TEXT2IMG_PROMPT = "A beautiful landscape with mountains and a lake" DEFAULT_IMG2IMG_PROMPT = "Transform this image with fantasy elements" # Default negative prompts - used to improve image quality by avoiding common issues DEFAULT_NEGATIVE_PROMPT = "blurry, low quality, distorted, deformed, ugly, pixelated, noise, grain, text, watermark, poor composition, bad proportions, disfigured, mutation, mutated, extra limbs, extra fingers, fused fingers, malformed hands, poorly drawn face, bad anatomy, amateur drawing, low resolution, duplicate, cropped, out of frame, worst quality, jpeg artifacts, compression artifacts, glitch, overexposed, underexposed, low contrast, washed out colors, oversaturated, signature, username, artist name, logo, unnatural lighting, uneven lighting, harsh shadows, motion blur, out of focus, chromatic aberration, film grain, scratches, stains, dark spots, light leaks, fuzzy edges, jagged edges, broken lines, stretched image, elongated features, asymmetrical eyes, misaligned features, missing details, incomplete rendering" # API settings API_HOST = os.getenv("API_HOST", "0.0.0.0") API_PORT = int(os.getenv("API_PORT", "8000")) # Gradio settings GRADIO_HOST = os.getenv("GRADIO_HOST", "0.0.0.0") GRADIO_PORT = int(os.getenv("GRADIO_PORT", "7860"))