Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
import os
|
4 |
+
os.kill(os.getpid(), 9) # This will crash Colab (required, everything will still be intact so dont worry)
|
5 |
+
|
6 |
+
"""Clone webui repository"""
|
7 |
+
|
8 |
+
# Commented out IPython magic to ensure Python compatibility.
|
9 |
+
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui /content/stable-diffusion-webui
|
10 |
+
# %cd /content/stable-diffusion-webui
|
11 |
+
|
12 |
+
|
13 |
+
#@title 1.3 Model
|
14 |
+
model_name = "wd-v1-3-float16.ckpt" #@param {type:"string"}
|
15 |
+
model_link = "https://huggingface.co/hakurei/waifu-diffusion-v1-3/resolve/main/wd-v1-3-float16.ckpt" #@param {type:"string"}
|
16 |
+
wget {model_link} -O models/Stable-diffusion/{model_name}
|
17 |
+
|
18 |
+
|
19 |
+
COMMANDLINE_ARGS="--exit" REQS_FILE="requirements.txt" python launch.py
|
20 |
+
|
21 |
+
"""Kill the runtime."""
|
22 |
+
|
23 |
+
import os
|
24 |
+
os.kill(os.getpid(), 9) # This will crash Colab (required, everything will still be intact so dont worry)
|
25 |
+
|
26 |
+
"""Change into Web UI directory and download updates"""
|
27 |
+
|
28 |
+
# Commented out IPython magic to ensure Python compatibility.
|
29 |
+
# %cd /content/stable-diffusion-webui
|
30 |
+
git pull
|
31 |
+
|
32 |
+
|
33 |
+
COMMANDLINE_ARGS="--share --gradio-debug" REQS_FILE="requirements.txt" python launch.py
|