File size: 1,562 Bytes
bed1967
 
 
 
 
 
 
7e5d515
 
 
 
 
 
 
 
 
 
 
bed1967
 
 
 
 
 
 
 
b9ba091
bed1967
 
 
b9ba091
bed1967
 
b9ba091
 
bed1967
 
b9ba091
 
 
 
 
 
 
bed1967
5aeda0b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/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"