-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·58 lines (47 loc) · 2 KB
/
setup.sh
File metadata and controls
executable file
·58 lines (47 loc) · 2 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
51
52
53
54
55
56
57
#!/usr/bin/env bash
set -e
# Interior Designer AI – Setup és Docker build script
# Ez a script minden szükséges modellt letölt, majd Docker Compose-szal buildeli és elindítja a konténereket.
# 1. Ellenőrizzük, hogy telepítve van-e a szükséges eszközök
for cmd in git wget docker docker-compose; do
if ! command -v "$cmd" &> /dev/null; then
echo "Hiba: '$cmd' nincs telepítve. Kérlek telepítsd, majd futtasd újra." >&2
exit 1
fi
done
# 2. Projekt gyökérmappába lépés (feltételezzük, hogy a script a project/ könyvtárban van)
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
cd "$SCRIPT_DIR"
# 3. SAM modell letöltése (segment-anything)
SAM_CKPT="chainlit_app/sam_vit_h.pth"
if [ ! -f "$SAM_CKPT" ]; then
echo "⬇️ Letöltés: Segment Anything checkpoint"
wget -O "$SAM_CKPT" \
https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth
fi
# 4. Stable Diffusion 1.5 modell letöltése
SD_MODEL_DIR="automatic1111/models/Stable-diffusion"
mkdir -p "$SD_MODEL_DIR"
if [ ! -f "$SD_MODEL_DIR/v1-5-pruned-emaonly.safetensors" ]; then
echo "⬇️ Letöltés: Stable Diffusion v1.5 modell"
wget -O "$SD_MODEL_DIR/v1-5-pruned-emaonly.safetensors" \
https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors
fi
# 5. ControlNet Canny modell letöltése
CN_DIR="automatic1111/models/ControlNet"
mkdir -p "$CN_DIR"
if [ ! -f "$CN_DIR/control_sd15_canny.pth" ]; then
echo "⬇️ Letöltés: ControlNet Canny modell"
wget -O "$CN_DIR/control_sd15_canny.pth" \
https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_canny.pth
fi
# 6. Docker image build
echo "🐳 Docker image-ek építése..."
docker-compose build --parallel
echo "🚀 Konténerek indítása (háttérben)..."
docker-compose up -d
# 7. Kész – URL-ek kiíratása
echo "
🔗 A Chainlit UI elérhető: http://localhost:8000"
echo "🔗 A Stable Diffusion WebUI elérhető: http://localhost:7860"
echo "✅ Setup kész!"