-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
50 lines (40 loc) · 1.54 KB
/
start.sh
File metadata and controls
50 lines (40 loc) · 1.54 KB
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
48
49
50
#!/usr/bin/env bash
set -e
echo "🚀 Starting container setup..."
# Auth HuggingFace if token provided
if [[ -n "$HF_TOKEN" ]]; then
echo "🔐 Authenticating with Hugging Face"
huggingface-cli login --token "$HF_TOKEN" --add-to-git-credential
fi
# === Conditional Model Setup ===
# Flux
if [[ "$DOWNLOAD_FLUX" == "true" ]]; then
echo "📥 Downloading Flux model and components..."
if [ ! -d "/workspace/models/flux" ]; then
git clone https://huggingface.co/blackforest-ai/fluxgym /workspace/models/flux
else
echo "⚠️ Flux model already exists, skipping..."
fi
fi
# HiDream
if [[ "$DOWNLOAD_HIDREAM" == "true" ]]; then
echo "📥 Downloading HiDream..."
mkdir -p /workspace/models/hidream
wget -nc -O /workspace/models/hidream/hidream_i1_dev_bf16.safetensors \
https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/resolve/main/split_files/diffusion_models/hidream_i1_dev_bf16.safetensors
fi
# WAN 2.1
if [[ "$DOWNLOAD_WAN" == "true" ]]; then
echo "📥 Downloading WAN 2.1 T2I..."
if [ ! -d "/workspace/models/wan" ]; then
git clone https://huggingface.co/Wan-AI/Wan2.1-T2V-14B /workspace/models/wan
else
echo "⚠️ WAN model already exists, skipping..."
fi
fi
# Launch Jupyter Notebook on port 8000 (listen-only, root, no token)
jupyter notebook --ip=0.0.0.0 --port=8000 --no-browser --allow-root --NotebookApp.token='' &
# === Training Placeholder ===
echo "✅ Environment setup complete."
echo "You can now run training commands inside the container."
exec "$@"