Setting Up Stable Diffusion on Colab
September 23, 2023 Update: Colab has officially banned Stable Diffusion WebUI and the disconnection issue cannot be resolved. This tutorial is now obsolete. See https://decrypt.co/197428/google-colab-stable-diffusion-web-ui-ban
AI Art
Stable Diffusion is a deep learning text-to-image model released by stability.ai in 2022, capable of running on most hardware with a modest GPU.
Colaboratory (Colab) is a hosted Jupyter notebook service by Google Research that provides free GPU/TPU compute resources.
This is a comprehensive guide for deploying Stable Diffusion on Colab. Follow the steps below to experience the magic of AI art.
Allocate Resources
Open the Stable_Diffusion_WebUi_Altryne Colab notebook.
Click Connect in the top-right corner to allocate cloud resources and connect to the runtime.

Run the commands in cell 1.0 to view host information.

You’ll usually get a Tesla T4; if you’re lucky enough to get a V100, that’s worth bragging about.
Configure the Model
First, register a Hugging Face account and generate a WRITE-type Access Token.

Return to Colab, expand the 1.4 Connect to Google Drive cell, check download_if_missing, and enter your Hugging Face Access Token.

Set Password
Configure a password in 2.1 Optional - Set webUI settings and configs before running.

Run the Service
Collapse all cells and run them sequentially to deploy the service.
Runtime:
- Setup stage: 5min
- Run the Stable Diffusion webui: 1s
- Launch WebUI for stable diffusion: 1min

A popup will request Google Drive login during runtime — log in and authorize normally.

Once complete, click the Public URL to enter the Stable Diffusion WebUI. Username is “wubei,” password is what you configured above.

Now enjoy! Enter a prompt to generate corresponding images, e.g., “an astronaut in the water.”

Of course, you can provide more detailed prompts for more specific and accurate images.
(((masterpiece))),((best quality)), flat chest,((loli)),((one girl)),very long light white hair, beautiful detailed red eyes,aqua eyes,white robe, cat ears,(flower hairpin),sunlight, light smile,blue necklace,see-through
