| """Core constants used throughout the application.""" | |
| import os | |
| # External storage configuration | |
| # If using external SSD, models will be cached at /Volumes/extssd/huggingface/hub | |
| # This is configured via environment variables (see .env file and run.sh script) | |
| # Model configuration | |
| DEFAULT_MODEL_ID = os.getenv("MODEL_ID", "stabilityai/stable-diffusion-xl-base-1.0") | |
| FALLBACK_MODEL_ID = "stabilityai/sdxl-turbo" # Lightweight fallback model | |
| DEFAULT_CONVNEXT_MODEL = "facebook/convnext-tiny-224" | |
| DEFAULT_CLIP_MODEL = "openai/clip-vit-base-patch32" | |
| # Training configuration | |
| TRAINING_DATA_DIR = "training_data" | |
| IMAGES_DIR = "training_data/images" | |
| MODELS_DIR = "training_data/trained_models" | |
| # Flower labels for classification | |
| FLOWER_LABELS = [ | |
| "rose", | |
| "tulip", | |
| "lily", | |
| "peony", | |
| "sunflower", | |
| "chrysanthemum", | |
| "carnation", | |
| "orchid", | |
| "hydrangea", | |
| "daisy", | |
| "dahlia", | |
| "ranunculus", | |
| "anemone", | |
| "marigold", | |
| "lavender", | |
| "magnolia", | |
| "gardenia", | |
| "camellia", | |
| "jasmine", | |
| "iris", | |
| "gerbera", | |
| "zinnia", | |
| "hibiscus", | |
| "lotus", | |
| "poppy", | |
| "sweet pea", | |
| "freesia", | |
| "lisianthus", | |
| "calla lily", | |
| "cherry blossom", | |
| "plumeria", | |
| "cosmos", | |
| ] | |
| # UI configuration | |
| DEFAULT_GENERATE_STEPS = 4 | |
| DEFAULT_WIDTH = 1024 | |
| DEFAULT_HEIGHT = 1024 | |
| DEFAULT_TOP_K = 7 | |
| DEFAULT_MIN_SCORE = 0.12 | |
| DEFAULT_NUM_COLORS = 3 | |
| # File extensions for image files | |
| SUPPORTED_IMAGE_EXTENSIONS = [".jpg", ".jpeg", ".png", ".webp"] | |