|
|
|
"""Copy of Notebook.ipynb |
|
|
|
Automatically generated by Colaboratory. |
|
|
|
Original file is located at |
|
https://colab.research.google.com/drive/1GtmzITCs5RRtzqmzOPZgne3hrx1d_CeI |
|
|
|
Adapted from: https://colab.research.google.com/drive/1AfAmwLMd_Vx33O9IwY2TmO9wKZ8ABRRa |
|
|
|
Adapted again from: https://colab.research.google.com/drive/1Iy-xW9t1-OQWhb0hNxueGij8phCyluOh |
|
""" |
|
|
|
!nvidia-smi |
|
|
|
import os |
|
os.kill(os.getpid(), 9) |
|
|
|
"""Clone webui repository""" |
|
|
|
|
|
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui /content/stable-diffusion-webui |
|
|
|
|
|
"""Download the model from huggingface. |
|
Leave the model name and link as default, unless you know what you are doing |
|
|
|
""" |
|
|
|
|
|
model_name = "wd-v1-3-float16.ckpt" |
|
model_link = "https://huggingface.co/hakurei/waifu-diffusion-v1-3/resolve/main/wd-v1-3-float16.ckpt" |
|
!wget {model_link} -O models/Stable-diffusion/{model_name} |
|
|
|
"""Install requirements, download repositories of stable diffusion""" |
|
|
|
!COMMANDLINE_ARGS="--exit" REQS_FILE="requirements.txt" python launch.py |
|
|
|
"""Kill the runtime.""" |
|
|
|
import os |
|
os.kill(os.getpid(), 9) |
|
|
|
"""Change into Web UI directory and download updates""" |
|
|
|
|
|
|
|
!git pull |
|
|
|
"""Launch web ui. Once it finishes launching, you will see `Running on public URL: xxxx.gradio.app` |
|
|
|
PLEASE WAIT 10 SECONDS BEFORE CLICKING THE LINK IN ORDER FOR EVERYTHING TO LOAD |
|
|
|
Click that link, and you are now using WD 1.3! |
|
|
|
Commandline arguments are: |
|
- `--share` - create online gradio.app link |
|
- `--gradio-debug` - print outputs to console |
|
- optional: `--gradio-auth me:qwerty` - add authentication to gradio: username me, password qwerty |
|
- see [wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Run-with-Custom-Parameters) for more options |
|
""" |
|
|
|
!COMMANDLINE_ARGS="--share --gradio-debug" REQS_FILE="requirements.txt" python launch.py |