forked from samsartor/stable-diffusion-webui-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_entrypoint.sh
executable file
·50 lines (42 loc) · 1.61 KB
/
docker_entrypoint.sh
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/bash
set -x
# The root directory of the webui server
cd /stable-diffusion-webui
# Make sure the correcte models dir exists in the file browser
mkdir -p /mnt/files/models
rm -rf /mnt/files/models.tmp
# Switch to a temporary directory in case the entrypoint dies
mv -T /mnt/files/models /mnt/files/models.tmp
# Copy small README-style files from the webui directory
rsync -ru ./models_init/. /mnt/files/models.tmp/
# Make the temporary directory official
mv -T /mnt/files/models.tmp /mnt/files/models
# Symlink the models directory into the webui directory where it is expected
ln -s /mnt/files/models
# Set up other persistant directories
for dir in saved outputs; do
mkdir -p /mnt/files/$dir
ln -s /mnt/files/$dir
done
serve-progress.py & disown
# Start downloading the model in the background
download-model.py \
'/mnt/files/models/Stable-diffusion' \
'https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/main/v2-1_768-ema-pruned.safetensors' \
'dcd690123cfc64383981a31d955694f6acf2072a80537fdb612c8e58ec87a8ac' \
'stable-diffusion-v2_1.safetensors' \
'https://civitai.com/api/download/models/128713' \
'879db523c30d3b9017143d56705015e15a2cb5628762c11d086fed9538abd7fd' \
'dreamshaper-v8.safetensors'
# Set the Huggingface cache dir
export HF_HOME=/data/.cache/huggingface
# Start the webui server
exec tini -- \
python -u webui.py \
--listen --port=7860 \
--precision full --no-half \
--allow-code --enable-insecure-extension-access --api \
--ui-settings-file /data/config.json --ui-config-file /data/ui-config.json \
--no-download-sd-model \
--hide-ui-dir-config \
--use-intel-oneapi