flowerfy / download_models.sh
Toy
Fix pre-commit configuration and resolve all linting issues
5aeda0b
#!/bin/bash
# Download all required models for Flowerfy application
# This script uses huggingface-hub CLI to download models with progress bars
echo "🌸 Downloading Flowerfy models using Hugging Face CLI..."
# Configure Hugging Face to use external SSD cache
if [ -d "/Volumes/extssd" ]; then
export HF_HOME="/Volumes/extssd/huggingface"
echo "✅ Using external SSD cache at: $HF_HOME"
# Ensure directory exists
mkdir -p "$HF_HOME/hub"
else
echo "⚠️ External SSD not found at /Volumes/extssd"
echo " Models will be downloaded to default cache: ~/.cache/huggingface/hub"
fi
# Check if huggingface-hub is installed
if ! command -v hf &> /dev/null; then
echo "📦 Installing huggingface-hub CLI..."
uv add huggingface-hub[cli]
fi
echo ""
echo "1️⃣ Downloading ConvNeXt model for flower classification..."
hf download facebook/convnext-tiny-224
echo ""
echo "2️⃣ Downloading CLIP model for fallback classification..."
hf download openai/clip-vit-base-patch32
echo ""
echo "3️⃣ Downloading SDXL model for image generation (~7GB)..."
hf download stabilityai/stable-diffusion-xl-base-1.0
echo ""
echo "4️⃣ Downloading FLUX.1-schnell model as backup (~23GB)..."
echo "⚠️ Note: FLUX may require HuggingFace authentication"
hf download black-forest-labs/FLUX.1-schnell || echo "⚠️ FLUX download failed - SDXL is the primary model"
echo ""
echo "🎉 Model downloads completed!"
echo "Total download size: ~30GB (if both models downloaded)"
echo ""
echo "You can now run: uv run python app.py"