
Run Stable Diffusion WebUI, AUTOMATIC1111 🤙¶
Welcome!
In this notebook, we will run the Stable Diffusion WebUI, AUTOMATIC1111. This UI lets you play around with Stable Diffusion image generatation without needing any code!
Help us make this tutorial better! Please provide feedback on Discord or on X.¶
A note about running Jupyter Notebooks: Press Shift + Enter to run a cell. A * in the left-hand cell box means the cell is running. A number means it has completed. If your Notebook is acting weird, you can interrupt a too-long process by interrupting the kernel (Kernel tab -> Interrupt Kernel) or even restarting the kernel (Kernel tab -> Restart Kernel). Note restarting the kernel will require you to run everything from the beginning.
Let's begin!¶
I used a GPU from brev.dev. I used an A10G, with 24GB GPU Memory, 16 GB RAM, 120 GB storage. This machine is about $1/hr.
Click the badge below to get your preconfigured instance:
Once you've checked out your machine and landed in your instance page, select the specs you'd like (I used Python 3.10 and CUDA 12.1.1; these should be preconfigured for you if you use the badge above) and click the "Build" button to build your verb container. Give this a few minutes.
A few minutes after your model has started Running, click the 'Notebook' button on the top right of your screen once it illuminates (you may need to refresh the screen). You will be taken to a Jupyter Lab environment, where you can upload this Notebook.
Note: You can connect your cloud credits (AWS or GCP) by clicking "Org: " on the top right, and in the panel that slides over, click "Connect AWS" or "Connect GCP" under "Connect your cloud" and follow the instructions linked to attach your credentials.
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
Cloning into 'stable-diffusion-webui'... remote: Enumerating objects: 30459, done. remote: Counting objects: 100% (148/148), done. remote: Compressing objects: 100% (82/82), done. remote: Total 30459 (delta 84), reused 111 (delta 66), pack-reused 30311 Receiving objects: 100% (30459/30459), 33.37 MiB | 9.46 MiB/s, done. Resolving deltas: 100% (21329/21329), done.
!pip install -q -U xformers matplotlib_inline
!sudo apt-get update && sudo apt-get -q install ffmpeg libsm6 libxext6 -y
import os
os.chdir('stable-diffusion-webui')
Now run the cell below, and just leave it running! When it completes, a window will pop up with your UI!¶
If you have any issues, go to http://127.0.0.1:7860/ in your browser when you see output about "model weights".
If you still have issues, run brev port-forward automatic1111-stable-diffusion-ui -p 7860:7860
on a terminal on your LOCAL machine (i.e. NOT from within this machine/notebook, but on your laptop). If you chose a different machine name, replace automatic1111-stable-diffusion-ui
with that name.
!bash <(wget -qO- https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh)
^C Interrupted with signal 2 in <frame at 0x55658e18d060, file '/home/ubuntu/.pyenv/versions/3.10.13/lib/python3.10/threading.py', line 324, code wait>