Xenos14 commited on
Commit
8e06df9
1 Parent(s): 24f2e10

Update on_start.sh

Browse files
Files changed (1) hide show
  1. on_start.sh +143 -0
on_start.sh CHANGED
@@ -1,6 +1,10 @@
1
  #!/bin/bash
2
  set -euo pipefail
3
 
 
 
 
 
4
  function download-model() {
5
  local _option=$1
6
  local _filename=$2
@@ -100,6 +104,145 @@ download-model --control-net "control_v1p_sd15_qrcode.yaml" "https://huggingface
100
 
101
 
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  ## ----------------------------
104
 
105
  ## Embedding
 
1
  #!/bin/bash
2
  set -euo pipefail
3
 
4
+ function download-model() {
5
+ local _option=$1#!/bin/bash
6
+ set -euo pipefail
7
+
8
  function download-model() {
9
  local _option=$1
10
  local _filename=$2
 
104
 
105
 
106
 
107
+ ## ----------------------------
108
+
109
+ ## Embedding
110
+ download-model --embedding "bad_prompt_version2.pt" "https://huggingface.co/datasets/Nerfgun3/bad_prompt/resolve/72fd9d6011c2ba87b5847b7e45e6603917e3cbed/bad_prompt_version2.pt"
111
+ download-model --embedding "easynegative.safetensors" "https://huggingface.co/embed/EasyNegative/resolve/main/EasyNegative.safetensors"
112
+ #download-model --embedding "microwaist_01bEmbedding.pt" "https://civitai.com/api/download/models/5246"
113
+
114
+ ## ----------------------------
115
+
116
+ ## Checkpoints:
117
+ download-model --checkpoint "babes_20.safetensors" "https://huggingface.co/Xenos14/zMine-TestModel/resolve/main/babes_20.safetensors"
118
+ download-model --checkpoint "icbinpICantBelieveIts_final.safetensors" "https://huggingface.co/Xenos14/zMine-TestModel/resolve/main/icbinpICantBelieveIts_final.safetensors"
119
+ #download-model --checkpoint "XenoGasmArt.safetensors" "https://huggingface.co/Xenos14/zMine-TestModel/resolve/main/XenoGasmArt.safetensors"
120
+ download-model --checkpoint "XenoGASM-v21.safetensors" "https://huggingface.co/Xenos14/XenoREALITY/resolve/main/XenoGASM-v1.safetensors"
121
+ #download-model --checkpoint "XenoEngine5th.1.safetensors" "https://huggingface.co/Xenos14/zMine-TestModel/resolve/main/XenoEngine5th.1.safetensors"
122
+ download-model --checkpoint "galenaREDUX_v10.safetensors" "https://huggingface.co/Xenos14/zMine-TestModel/resolve/main/galenaREDUX_v10.safetensors"
123
+ download-model --checkpoint "XenoENGINE-ArtStyle-v4.7.safetensors" "https://huggingface.co/Xenos14/XenoREALITY/resolve/main/XenoENGINE-Artstyle-v4.7.safetensors"
124
+ download-model --checkpoint "XenoREALITY-v1.safetensors" "https://huggingface.co/Xenos14/XenoREALITY/resolve/main/XenoREALITY-v1.safetensors"
125
+
126
+ ## ----------------------------
127
+
128
+ ## Add additional models that you want to install on startup. Replace URL and FILENAME from the examples below with your values.
129
+
130
+ ## Usage:
131
+ ## download-model --checkpoint <filename> <url>
132
+ ## download-model --lora <filename> <url>
133
+ ## download-model --vae <filename> <url>
134
+ ## download-model --control-net <filename> <url>
135
+ ## download-model --embedding <filename> <url>
136
+
137
+ ## ----------------------------
138
+
139
+
140
+ ## Checkpoint · Example:
141
+ # download-model --checkpoint "FILENAME" "URL"
142
+
143
+ ## LORA (low-rank adaptation) · Example:
144
+ # download-model --lora "FILENAME" "URL"
145
+
146
+ ## VAE (variational autoencoder) · Example:
147
+ # download-model --vae "FILENAME" "URL"
148
+
149
+ local _filename=$2
150
+ local _url=$3
151
+ local _dir
152
+
153
+ ! [ $# -eq 3 ] && (echo "usage: "; for o in checkpoint lora vae control-net embedding; do echo " \$ download-model --$o <filename> <url>"; done) || true
154
+ [ $# -eq 0 ] && return 0 || ! [ $# -eq 3 ] && (echo ""; echo "error - invalid number of arguments (expected 3, received $#)"; echo -n "\$ download-model $1"; (for arg in "${@: 2}"; do echo -n " \"${arg//\"/\\\"}\""; done) && echo "") && return 1 || true
155
+
156
+ case ${_option,,} in
157
+ --checkpoint) _dir="/app/stable-diffusion-webui/models/Stable-diffusion";;
158
+ --lora) _dir="/app/stable-diffusion-webui/extensions/sd-webui-additional-networks/models/LoRA";;
159
+ --vae) _dir="/app/stable-diffusion-webui/models/VAE";;
160
+ --control-net) _dir="/app/stable-diffusion-webui/models/ControlNet";;
161
+ --embedding) _dir="/app/stable-diffusion-webui/embeddings";;
162
+
163
+ *) echo "error - unknown first argument: '$1' (valid options are --checkpoint, --lora, --vae, --control-net or --embedding):"; echo "\$ download-model $1 \"$2\" \"$3\""; return 1;;
164
+ esac
165
+
166
+ echo "\$ download-model $_option \"$2\" \"$3\"" ; echo ""
167
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $_url -d $_dir -o $_filename && echo ""
168
+ }
169
+
170
+ ## ----------------------------
171
+
172
+ ## Adds a header to the webui on Hugging Face Spaces.
173
+ sed -i -e '/demo:/r /app/stable-diffusion-webui/header_patch.py' /app/stable-diffusion-webui/modules/ui.py
174
+
175
+ ## ----------------------------
176
+
177
+ ## Installing less models if $IS_SHARED_UI environment variable is set.
178
+ if [ ${IS_SHARED_UI:-0} != 0 ]; then
179
+ download-model --checkpoint "v1-5-pruned-emaonly.safetensors" "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/39593d5650112b4cc580433f6b0435385882d819/v1-5-pruned-emaonly.safetensors"
180
+ download-model --checkpoint "v1-5-pruned-emaonly.yaml" "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/39593d5650112b4cc580433f6b0435385882d819/v1-inference.yaml"
181
+ download-model --control-net "cldm_v15.yaml" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/cldm_v15.yaml"
182
+ download-model --control-net "control_canny-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_canny-fp16.safetensors"
183
+ download-model --control-net "control_depth-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_depth-fp16.safetensors"
184
+ download-model --control-net "control_normal-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_normal-fp16.safetensors"
185
+ download-model --control-net "control_openpose-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_openpose-fp16.safetensors"
186
+ download-model --control-net "control_scribble-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_scribble-fp16.safetensors"
187
+ download-model --checkpoint "AtoZovyaRPGArtistTools15_sd15V1.safetensors" "https://civitai.com/api/download/models/10185"
188
+ download-model --embedding "bad_prompt_version2.pt" "https://huggingface.co/datasets/Nerfgun3/bad_prompt/resolve/72fd9d6011c2ba87b5847b7e45e6603917e3cbed/bad_prompt_version2.pt"
189
+ sed -i -e '/(modelmerger_interface, \"Checkpoint Merger\", \"modelmerger\"),/d' /app/stable-diffusion-webui/modules/ui.py
190
+ sed -i -e '/(train_interface, \"Train\", \"ti\"),/d' /app/stable-diffusion-webui/modules/ui.py
191
+ sed -i -e '/extensions_interface, \"Extensions\", \"extensions\"/d' /app/stable-diffusion-webui/modules/ui.py
192
+ sed -i -e '/settings_interface, \"Settings\", \"settings\"/d' /app/stable-diffusion-webui/modules/ui.py
193
+ rm -rf /app/stable-diffusion-webui/scripts /app/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui /app/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser /app/stable-diffusion-webui/extensions/sd-civitai-browser /app/stable-diffusion-webui/extensions/sd-webui-additional-networks
194
+ cp -f shared-config.json config.json
195
+ cp -f shared-ui-config.json ui-config.json
196
+ exit 0
197
+ fi
198
+ ## End of lightweight installation for $IS_SHARED_UI setup.
199
+
200
+ ## ----------------------------
201
+ ## env $IS_SHARED_UI is not set
202
+ ## ----------------------------
203
+
204
+ ## Stable Diffusion 2.1 · 768 base model:
205
+ #download-model --checkpoint "v2-1_768-ema-pruned.safetensors" "https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/36a01dc742066de2e8c91e7cf0b8f6b53ef53da1/v2-1_768-ema-pruned.safetensors"
206
+ #download-model --checkpoint "v2-1_768-ema-pruned.yaml" "https://raw.githubusercontent.com/Stability-AI/stablediffusion/fc1488421a2761937b9d54784194157882cbc3b1/configs/stable-diffusion/v2-inference-v.yaml"
207
+
208
+ ## Stable Diffusion 1.5 · 512 base model:
209
+ #download-model --checkpoint "v1-5-pruned-emaonly.safetensors" "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors"
210
+ #download-model --checkpoint "v1-5-pruned-emaonly.yaml" "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/39593d5650112b4cc580433f6b0435385882d819/v1-inference.yaml"
211
+
212
+ ## ----------------------------
213
+
214
+ ## LoRA (low-rank adaptation) · epi_noiseoffset v2:
215
+ #download-model --lora "hyperfusion100k_v4.safetensors" "https://civitai.com/api/download/models/19987"
216
+ #download-model --lora "jimLeeDCComicsMarvel_offset.safetensors" "https://civitai.com/api/download/models/10580"
217
+ #download-model --lora "epi_noiseoffset2.safetensors" "https://civitai.com/api/download/models/16576"
218
+ #download-model --lora "agneseInnocente_1.safetensors" "https://civitai.com/api/download/models/34144"
219
+ #download-model --lora "seethru_v10.safetensors" "https://civitai.com/api/download/models/32083"
220
+ #download-model --lora "CommunityLoraExtract_lora320comicbabesV1.safetensors" "https://civitai.com/api/download/models/33744"
221
+ #download-model --lora "CommunityLoraExtract_lora320revanimated.safetensors" "https://civitai.com/api/download/models/33787"
222
+
223
+ ## ----------------------------
224
+
225
+ ## VAE (variational autoencoder) · VAE 840k EMA:
226
+ download-model --vae "vae-ft-mse-840000-ema-pruned.safetensors" "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors"
227
+ download-model --vae "Grapefruit.vae.pt" "https://huggingface.co/iZELX1/Grapefruit/resolve/main/Grapefruit.vae.pt"
228
+ download-model --vae "kl-f8-anime.ckpt" "https://huggingface.co/hakurei/waifu-diffusion-v1-4/resolve/main/vae/kl-f8-anime.ckpt"
229
+
230
+ ## ----------------------------
231
+
232
+ ## ControlNet · Pre-extracted models:
233
+ download-model --control-net "cldm_v15.yaml" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/cldm_v15.yaml"
234
+ download-model --control-net "cldm_v21.yaml" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/cldm_v21.yaml"
235
+ download-model --control-net "control_canny-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_canny-fp16.safetensors"
236
+ download-model --control-net "control_depth-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_depth-fp16.safetensors"
237
+ download-model --control-net "control_hed-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_hed-fp16.safetensors"
238
+ download-model --control-net "control_normal-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_normal-fp16.safetensors"
239
+ download-model --control-net "control_openpose-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_openpose-fp16.safetensors"
240
+ download-model --control-net "control_scribble-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_scribble-fp16.safetensors"
241
+ download-model --control-net "control_v1p_sd15_qrcode.safetensors" "https://huggingface.co/DionTimmer/controlnet_qrcode/resolve/main/control_v1p_sd15_qrcode.safetensors"
242
+ download-model --control-net "control_v1p_sd15_qrcode.yaml" "https://huggingface.co/DionTimmer/controlnet_qrcode/resolve/main/control_v1p_sd15_qrcode.yaml"
243
+
244
+
245
+
246
  ## ----------------------------
247
 
248
  ## Embedding