This is an extremely simple PowerShell script that will:
- install AUTOMATIC1111's stable-diffusion-webui (https://github.com/AUTOMATIC1111/stable-diffusion-webui)
download the Stable Diffusion v1.5 model file (https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.ckpt - warning, direct link to 7.2GB file)this is automatically done by the webui on initial startup if no models are found- create a startup .bat file on the Desktop titled "StableDiffusion.bat"
To accomplish this, it takes the following steps (labelled in the file):
- Install scoop (https://scoop.sh)
- Use scoop to install pyenv-win (https://github.com/pyenv-win/pyenv-win) and git (https://git-scm.com/)
- Use pyenv to install Python 3.10.6
- Use git to clone the stable-diffusion-webui project to the user's Desktop
- Write the startup .bat to the user's Desktop
This sets the webui to run using the --medvram
and --xformers
flags - this can be changed in the webui-user.bat
file.
Updates to requirements (such as migrating from one version of torch to another) are NOT handled by either this script or the resulting startup .bat file.
The startup .bat this creates on the Desktop will automatically pull the latest version of stable-diffusion-webui upon running - if that is undesirable, simply remove the call to git pull
within it.
I chose scoop and pyenv specifically because they don't require any special permissions to install themselves, and leave the rest of the computer untouched - running this script shouldn't affect existing installations of anything outside of the Scoop ecosystem.