carloscar commited on
Commit
4cdb990
1 Parent(s): 93d966a

cleaning up on_start.sh script

Browse files
Files changed (2) hide show
  1. on_start.sh +101 -40
  2. run.py +1 -1
on_start.sh CHANGED
@@ -1,43 +1,104 @@
1
  #!/bin/bash
2
  set -euo pipefail
3
 
4
- # SD 2.1 768 base model
5
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/36a01dc742066de2e8c91e7cf0b8f6b53ef53da1/v2-1_768-ema-pruned.safetensors -d /app/stable-diffusion-webui/models/Stable-diffusion -o v2-1_768-ema-pruned.safetensors
6
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://raw.githubusercontent.com/Stability-AI/stablediffusion/fc1488421a2761937b9d54784194157882cbc3b1/configs/stable-diffusion/v2-inference-v.yaml -d /app/stable-diffusion-webui/models/Stable-diffusion -o v2-1_768-ema-pruned.yaml
7
-
8
- # SD 1.5 base model
9
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/39593d5650112b4cc580433f6b0435385882d819/v1-5-pruned-emaonly.safetensors -d /app/stable-diffusion-webui/models/Stable-diffusion -o v1-5-pruned-emaonly.safetensors
10
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/39593d5650112b4cc580433f6b0435385882d819/v1-inference.yaml -d /app/stable-diffusion-webui/models/Stable-diffusion -o v1-5-pruned-emaonly.yaml
11
-
12
- # VAE
13
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/629b3ad3030ce36e15e70c5db7d91df0d60c627f/vae-ft-mse-840000-ema-pruned.safetensors -d /app/stable-diffusion-webui/models/VAE -o vae-ft-mse-840000-ema-pruned.safetensors
14
-
15
- # Pre-extracted controlnet models
16
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/cldm_v15.yaml -d /app/stable-diffusion-webui/models/ControlNet -o cldm_v15.yaml
17
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/cldm_v21.yaml -d /app/stable-diffusion-webui/models/ControlNet -o cldm_v21.yaml
18
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_canny-fp16.safetensors -d /app/stable-diffusion-webui/models/ControlNet -o control_canny-fp16.safetensors
19
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_depth-fp16.safetensors -d /app/stable-diffusion-webui/models/ControlNet -o control_depth-fp16.safetensors
20
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_hed-fp16.safetensors -d /app/stable-diffusion-webui/models/ControlNet -o control_hed-fp16.safetensors
21
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_mlsd-fp16.safetensors -d /app/stable-diffusion-webui/models/ControlNet -o control_mlsd-fp16.safetensors
22
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_normal-fp16.safetensors -d /app/stable-diffusion-webui/models/ControlNet -o control_normal-fp16.safetensors
23
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_openpose-fp16.safetensors -d /app/stable-diffusion-webui/models/ControlNet -o control_openpose-fp16.safetensors
24
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_scribble-fp16.safetensors -d /app/stable-diffusion-webui/models/ControlNet -o control_scribble-fp16.safetensors
25
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_seg-fp16.safetensors -d /app/stable-diffusion-webui/models/ControlNet -o control_seg-fp16.safetensors
26
-
27
- # Dreamlike Diffusion 1.0 model
28
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/dreamlike-art/dreamlike-diffusion-1.0/resolve/00cbe4d56fd56f45e952a5be4d847f21b9782546/dreamlike-diffusion-1.0.safetensors -d /app/stable-diffusion-webui/models/Stable-diffusion -o dreamlike-diffusion-1.0.safetensors
29
-
30
- # Dreamshaper 3.31 model
31
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Lykon/DreamShaper/resolve/d227e39aab5e360aec6401be916025ddfc8127bd/DreamShaper_3.31_baked_vae-inpainting.inpainting.safetensors -d /app/stable-diffusion-webui/models/Stable-diffusion -o DreamShaper_3.31_baked_vae-inpainting.inpainting.safetensors
32
-
33
- # dalcefo_painting model
34
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://civitai.com/api/download/models/14675?type=Pruned%20Model&format=SafeTensor" -d /app/stable-diffusion-webui/models/Stable-diffusion -o dalcefoPainting_2nd.safetensors
35
-
36
- # The Ally's Mix III: Revolutions model
37
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://civitai.com/api/download/models/12763?type=Model&format=SafeTensor" -d /app/stable-diffusion-webui/models/Stable-diffusion -o theAllysMixIII_v10.safetensors
38
-
39
- # Deliberate v2 model
40
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://civitai.com/api/download/models/15236?type=Model&format=SafeTensor" -d /app/stable-diffusion-webui/models/Stable-diffusion -o deliberate_v2.safetensors
41
-
42
- # RPG v4 model
43
- aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Anashel/rpg/resolve/main/RPG-V4-Model-Download/RPG-v4.safetensors -d /app/stable-diffusion-webui/models/Stable-diffusion -o RPG-v4.safetensors
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #!/bin/bash
2
  set -euo pipefail
3
 
4
+ function download-model() {
5
+ local _option=$1
6
+ local _filename=$2
7
+ local _url=$3
8
+ local _dir
9
+
10
+ ! [ $# -eq 3 ] && (echo "usage: "; for o in checkpoint lora vae control-net; do echo " \$ download-model --$o <filename> <url>"; done) || true
11
+ [ $# -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
12
+
13
+ case ${_option,,} in
14
+ --checkpoint) _dir="/app/stable-diffusion-webui/models/Stable-diffusion";;
15
+ --lora) _dir="/app/stable-diffusion-webui/extensions/sd-webui-additional-networks/models/LoRA";;
16
+ --vae) _dir="/app/stable-diffusion-webui/models/VAE";;
17
+ --control-net) _dir="/app/stable-diffusion-webui/models/ControlNet";;
18
+
19
+ *) echo "error - unknown first argument: '$1' (valid options are --checkpoint, --lora, --vae or --control-net):"; echo "\$ download-model $1 \"$2\" \"$3\""; return 1;;
20
+ esac
21
+
22
+ echo "\$ download-model $_option \"$2\" \"$3\""
23
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $_url -d $_dir -o $_filename
24
+ }
25
+
26
+ ## ----------------------------
27
+
28
+ ## Stable Diffusion 2.1 · 768 base model:
29
+ 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"
30
+ download-model --checkpoint "v2-1_768-ema-pruned.yaml" "https://raw.githubusercontent.com/Stability-AI/stablediffusion/fc1488421a2761937b9d54784194157882cbc3b1/configs/stable-diffusion/v2-inference-v.yaml"
31
+
32
+ ## Stable Diffusion 1.5 · 512 base model:
33
+ download-model --checkpoint "v1-5-pruned-emaonly.safetensors" "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/39593d5650112b4cc580433f6b0435385882d819/v1-5-pruned-emaonly.safetensors"
34
+ download-model --checkpoint "v1-5-pruned-emaonly.yaml" "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/39593d5650112b4cc580433f6b0435385882d819/v1-inference.yaml"
35
+
36
+ ## ----------------------------
37
+
38
+ ## LoRA (low-rank adaptation) · epi_noiseoffset v2:
39
+ download-model --lora "epiNoiseoffset_v2.safetensors" "https://civitai.com/api/download/models/16576?type=Model&format=SafeTensor"
40
+
41
+ ## ----------------------------
42
+
43
+ ## VAE (variational autoencoder) · VAE 840k EMA:
44
+ download-model --vae "vae-ft-mse-840000-ema-pruned.safetensors" "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/629b3ad3030ce36e15e70c5db7d91df0d60c627f/vae-ft-mse-840000-ema-pruned.safetensors"
45
+
46
+ ## ----------------------------
47
+
48
+ ## ControlNet · Pre-extracted models:
49
+ download-model --control-net "cldm_v15.yaml" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/cldm_v15.yaml"
50
+ download-model --control-net "cldm_v21.yaml" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/cldm_v21.yaml"
51
+ download-model --control-net "control_canny-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_canny-fp16.safetensors"
52
+ download-model --control-net "control_depth-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_depth-fp16.safetensors"
53
+ download-model --control-net "control_hed-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_hed-fp16.safetensors"
54
+ download-model --control-net "control_normal-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_normal-fp16.safetensors"
55
+ download-model --control-net "control_openpose-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_openpose-fp16.safetensors"
56
+ download-model --control-net "control_scribble-fp16.safetensors" "https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/87c3affbcad3baec52ffe39cac3a15a94902aed3/control_scribble-fp16.safetensors"
57
+
58
+ ## ----------------------------
59
+
60
+ ## Checkpoint · The Ally's Mix III: Revolutions:
61
+ download-model --checkpoint "theAllysMixIII_v10.safetensors" "https://civitai.com/api/download/models/12763?type=Model&format=SafeTensor"
62
+
63
+ ## Checkpoint · Dreamlike Diffusion 1.0:
64
+ # download-model --checkpoint "dreamlike-diffusion-1.0.safetensors" "https://huggingface.co/dreamlike-art/dreamlike-diffusion-1.0/resolve/00cbe4d56fd56f45e952a5be4d847f21b9782546/dreamlike-diffusion-1.0.safetensors"
65
+
66
+ ## Checkpoint · Dreamshaper 3.31:
67
+ # download-model --checkpoint "DreamShaper_3.31_baked_vae-inpainting.inpainting.safetensors" "https://huggingface.co/Lykon/DreamShaper/resolve/d227e39aab5e360aec6401be916025ddfc8127bd/DreamShaper_3.31_baked_vae-inpainting.inpainting.safetensors"
68
+
69
+ ## Checkpoint · dalcefo_painting:
70
+ # download-model --checkpoint "dalcefoPainting_2nd.safetensors" "https://civitai.com/api/download/models/14675?type=Pruned%20Model&format=SafeTensor"
71
+
72
+ ## Checkpoint · Deliberate v2:
73
+ # download-model --checkpoint "deliberate_v2.safetensors" "https://civitai.com/api/download/models/15236?type=Model&format=SafeTensor"
74
+
75
+ ## Checkpoint · RPG v4:
76
+ # download-model --checkpoint "RPG-v4.safetensors" "https://huggingface.co/Anashel/rpg/resolve/main/RPG-V4-Model-Download/RPG-v4.safetensors"
77
+
78
+ ## Checkpoint · A to Zovya RPG Artist's Tools (SD 1.5):
79
+ # download-model --checkpoint "AtoZovyaRPGArtistTools15_sd15V1.safetensors" "https://civitai.com/api/download/models/10185"
80
+
81
+ ## Checkpoint · A to Zovya RPG Artist's Tools (SD 2.1):
82
+ # download-model --checkpoint "AtoZovyaRPGArtistTools15_sd21768V1.safetensors" "https://civitai.com/api/download/models/9593?type=Model&format=SafeTensor"
83
+ # download-model --checkpoint "aToZovyaRPGArtistsTools15_sd21768V1.yaml" "https://civitai.com/api/download/models/9593?type=Config&format=Other"
84
+
85
+ ## ----------------------------
86
+
87
+ ## Add additional models that you want to install on startup. Replace URL and FILENAME from the examples below with your values.
88
+
89
+ ## Usage:
90
+ ## download-model --checkpoint <filename> <url>
91
+ ## download-model --lora <filename> <url>
92
+ ## download-model --vae <filename> <url>
93
+ ## download-model --control-net <filename> <url>
94
+
95
+ ## ----------------------------
96
+
97
+ ## Checkpoint · Example:
98
+ # download-model --checkpoint "FILENAME" "URL"
99
+
100
+ ## LORA (low-rank adaptation) · Example:
101
+ # download-model --lora "FILENAME" "URL"
102
+
103
+ ## VAE (variational autoencoder) · Example:
104
+ # download-model --vae "FILENAME" "URL"
run.py CHANGED
@@ -5,7 +5,7 @@ import sys
5
 
6
  def on_start():
7
  print("---------------")
8
- print("Executing './on_start.sh' (downloads models, etc.)")
9
  print("---------------")
10
  result = subprocess.run("./on_start.sh", shell=True, env=os.environ)
11
  if result.returncode != 0:
 
5
 
6
  def on_start():
7
  print("---------------")
8
+ print("Starting script './on_start.sh' to downloads models ...")
9
  print("---------------")
10
  result = subprocess.run("./on_start.sh", shell=True, env=os.environ)
11
  if result.returncode != 0: