File size: 2,255 Bytes
44cca4b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# -*- 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 |