How to Use Stable Diffusion WebUI on Colab!
Hello, it's Fureko ! in this guide I will show you how to use Stable Diffusion on Google Colab for free.
Google Colab is a service provided by Google that gives you access to a cloud-based computer for various tasks. It mainly uses Python and Ruby (but Python is the most common one due to its simplicity).
"Stable Diffusion vs WebUI"
- Stable Diffusion: the program that generates images via models.
- WebUI: the interface that allows you to communicate with Stable Diffusion (prompts, models, etc...).
That’s why in this guide we will install Stable Diffusion first before launching the WebUI interface.
Nothing is permanently stored on Colab’s storage space!
You also get a limited session time to use a GPU. Once you’re done with Stable Diffusion, go to the small arrow next to server resources → "Manage sessions" → stop the current session.


Even though Colab is a great service, nothing is saved on Colab’s own servers!
That means if you save important files, they will disappear once your session ends.
So DO NOT SAVE anything on Colab directly, only use your Google Drive.
And yes, this also means that at the start of every new Colab session you’ll need to redo the installation and launch steps for Stable Diffusion.
It’s the only real downside of Colab, but honestly not too bad.
In this guide you’ll learn the basics of using and launching Stable Diffusion. This trick is especially useful for people who can’t run Stable Diffusion locally due to lack of resources.
• Prerequisites
Before launching the notebook, you’ll need to create a Gmail account with an empty Drive, and also get your CivitAI API key.
1 - Create a new Google email address
This is an important step so you can have a completely empty Google Drive just for Colab, without cluttering your main account. 15 GB may not seem like much, but it’s enough — especially since Colab gives you 80 GB of free temporary space during each session.
2 - Save the notebook to your Drive
- A notebook (or Jupyter Notebook) is a text file containing ready-to-run code blocks. It can be modified and makes sharing code much easier.
Notebook link:
👉 https://colab.research.google.com/drive/1hnoIh6r4wy8a-FUTD1qHKBzaEVWomOtE?usp=sharing
- Once opened and connected with your Google account, go to File → Save a copy in Drive.
- Close the page. Another tab should open with the notebook now saved in your Drive. (If not, go to your new Drive account and open it from there).


3 - Get your CivitAI API Key
This step is crucial for downloading models or Loras directly from Stable Diffusion’s interface.
- Go to CivitAI.
- Create an account (or log in).
- Click your profile (top right) → Account Settings.
- Scroll down to find API Keys → create a new one.
- Click Add API Key and give it a name (example: "Colab").
- CivitAI will then show you your API key.




You will only see this key once, so save it securely!
• Notebook Setup
There are just a few steps before you can launch the notebook. Focus on the first block: WebUI Installer.
- Follow the instructions:
Webui → set to A1111
Civitai_key → paste your API key from CivitAI
HF_Read_Token → leave it empty
Mount Drive → set to Yes

• Install Stable Diffusion
Click the small triangle button to run the installation code.
Make sure you are connected with T4 GPU — otherwise, you won’t have GPU access (which is required for Stable Diffusion).

When you launch it, you’ll get a prompt asking if you want to connect to Google Drive.
Click "Allow" and continue.


Also, accept all permissions when Colab asks for Drive access, otherwise the notebook won’t work.

Wait a few minutes while everything installs. During this time, you can already prepare by modifying a few code blocks.

• Modify the Code
Scroll down until you find a block labeled Checkpoint and Lora.
This is normal — Stable Diffusion installs its own default models.

By default, it installs:
bigblu25dmix25DStyle_v10.safetensors
But you can replace this with your own model.
Steps:
- Go to CivitAI and open your chosen model’s page.
- Right-click (or long-press on mobile) the Download button — don’t download it to your device, just copy the link for the download.
- Replace the default model’s link in the notebook with your chosen one.


👉 For Loras, do the same but paste the link under the Lora.
(If you want to add multiple models, just go to a new line and add %download [URL]).
• Download Models or Loras
- Once installation finishes, you should see
[Done]. This means Stable Diffusion is installed correctly.

- Then run the Checkpoint block to install your chosen models and Loras.
- Wait until the downloads are completed.

• Launch the Stable Diffusion WebUI
Final step: just click the Launch WebUI button.

Stable Diffusion will be ready once you see three links appear. These are portals to Colab’s local server.
👉 Use either Gradio or CloudFlared to open the WebUI.

✅ Congratulations — you now have Stable Diffusion running on Colab!

• Useful Tools
- All images you generate are automatically saved to your Google Drive:
Segsmaker → Output → txt2img → [Date]
Keep an eye on your Drive storage! Clean up old files to save space.
⚠️ Do not touch any system folders other than your output — deleting them may break Stable Diffusion.
- To download models or Loras directly from the interface:
Go to CivitAI Browser+, search for your model, apply filters if needed, select version, and click Download Model. It will automatically be saved in the correct Stable Diffusion folder.


"TensorArt vs CivitAI"
What if a model is available on TensorArt but not on CivitAI?
- The downside: you won’t be able to fetch models directly from TensorArt in Colab (many creators block downloads or make them pay-to-access).
- Workaround: manually upload the model file into Colab’s storage.
In the last code block of the notebook, I included a External Files Code. This allows you to add, edit, or delete files directly inside Colab.


Important: only run the file manager after installing Stable Diffusion (first code block).
Do not launch it after starting WebUI — it will interrupt the interface.
- The Stable Diffusion folder is named A1111.
For models:
A1111/Models/Stable-Diffusion/
For Loras:
A1111/Models/Lora/
👉 Upload your downloaded model or Lora file there manually (from TensorArt or anywhere else).
A video guide here