Download copy_of_notebook.py from args/difusion: direct link, hf CLI and curl.
- Browser
- Download file 2.26 kB
-
https://huggingface.co/spaces/args/difusion/resolve/main/copy_of_notebook.py
- Command line
-
hf download hf://spaces/args/difusion/copy_of_notebook.py
-
curl -L -o copy_of_notebook.py https://huggingface.co/spaces/args/difusion/resolve/main/copy_of_notebook.py
2.26 kB
| # -*- coding: utf-8 -*- | |
| """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) # This will crash Colab (required, everything will still be intact so dont worry) | |
| """Clone webui repository""" | |
| # Commented out IPython magic to ensure Python compatibility. | |
| !git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui /content/stable-diffusion-webui | |
| # %cd /content/stable-diffusion-webui | |
| """Download the model from huggingface. | |
| Leave the model name and link as default, unless you know what you are doing | |
| """ | |
| #@title 1.3 Model | |
| model_name = "wd-v1-3-float16.ckpt" #@param {type:"string"} | |
| model_link = "https://huggingface.co/hakurei/waifu-diffusion-v1-3/resolve/main/wd-v1-3-float16.ckpt" #@param {type:"string"} | |
| !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) # This will crash Colab (required, everything will still be intact so dont worry) | |
| """Change into Web UI directory and download updates""" | |
| # Commented out IPython magic to ensure Python compatibility. | |
| # %cd /content/stable-diffusion-webui | |
| !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 |