-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomatic1111-webui.sh
executable file
·115 lines (88 loc) · 2.79 KB
/
automatic1111-webui.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
set -e -u -o pipefail;
declare progname=${0##*/};
declare progpath=${0%/*};
pushd "${progpath}";
source common.sh;
declare tag;
declare parentdir=automatic1111/;
declare projectsubdir=stable-diffusion-webui/;
declare optupdate="false";
while getopts ":u" arg; do
case $arg in
u) # Update the codebase
optupdate="true";
;;
esac
done
aptinstall \
libgl1 \
libglib2.0-0 \
libgoogle-perftools-dev \
python3-pip \
python3.10-venv;
mkdir --parents --verbose "${rootdir}${parentdir}";
cd "${rootdir}${parentdir}";
if [ ! -d "${projectsubdir}" ]; then
optupdate="true";
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git "${projectsubdir}";
fi
cd "${projectsubdir}";
if [ "${optupdate}" == "true" ]; then
git fetch --all;
git checkout master;
git pull;
fi
if [ ! -d venv ]; then
python3.10 -m venv venv/;
fi
source venv/bin/activate;
tag=$(git tag |
grep --extended-regexp --invert-match "(pre|RC)" |
sort --reverse --version-sort |
head --lines=1);
if [ "${optupdate}" == "true" ]; then
git checkout "${tag}";
fi
python -m pip install --upgrade pip;
#python -m pip install --upgrade httpcore;
python -m pip install httpx==0.24.1;
linkcentraldir "textual_inversion_templates" textual_inversion_templates/;
linkconfigsdir "${parentdir}${projectsubdir}" config/;
linkmodelsdir "embeddings" embeddings/;
linkmodelsdir "blip" models/BLIP/;
linkmodelsdir "clip-interrogator" models/clip-interrogator/;
linkmodelsdir "codeformer" models/Codeformer/;
linkmodelsdir "controlnet" models/ControlNet/;
linkmodelsdir "deepbooru" models/deepbooru/;
linkmodelsdir "esrgan" models/ESRGAN/;
linkmodelsdir "gfpgan" models/GFPGAN/;
linkmodelsdir "hed" models/hed/;
linkmodelsdir "hypernetworks" models/hypernetworks/;
linkmodelsdir "karlo" models/karlo/;
linkmodelsdir "ldsr" models/LDSR/;
linkmodelsdir "lora" models/Lora/;
linkmodelsdir "lycoris" models/LyCORIS/;
linkmodelsdir "mlsd" models/mlsd/;
linkmodelsdir "normal_bae" models/normal_bae/;
linkmodelsdir "opencv" models/opencv/;
linkmodelsdir "openpose" models/openpose/;
linkmodelsdir "pidinet" models/pidinet/;
linkmodelsdir "realesrgan" models/RealESRGAN/;
linkmodelsdir "stable-diffusion" models/Stable-diffusion/;
linkmodelsdir "swinir" models/SwinIR/;
linkmodelsdir "torch_deepdanbooru" models/torch_deepdanbooru/;
linkmodelsdir "vae" models/VAE/;
linkmodelsdir "vae-approx" models/VAE-approx/;
linkoutputsdir "${parentdir}${projectsubdir}" outputs/;
mvlinkfile config.json config/;
mvlinkfile params.txt config/;
mvlinkfile styles.csv config/;
mvlinkfile ui-config.json config/;
git restore webui-user.sh;
sed \
--expression='s/#python_cmd="python3"/python_cmd="python"/' \
--expression='s/#export COMMANDLINE_ARGS=""/#export COMMANDLINE_ARGS="--api --xformers"/' \
webui-user.sh \
--in-place;
./webui.sh;