To run Stable Diffusion with Automatic1111 on Google Colab, you'll first need to create an account on Google Colab. After creating your account, follow the steps below:
-
If you have a specific repository or code file that you want to run, open the URL: https://colab.research.google.com/github and search for the appropriate notebook file (with a ".ipynb" extension) in the repository. You can also simply click on the "Open in Colab" button that might be available on the repository page (if provided by the Automatic1111 team).
-
If you don't have a specific repository to use, you can create a new Colab notebook from scratch and run the code. To do this, go to https://colab.research.google.com/ and click on "New Notebook." If you want to work on this existing code provided by Automatic1111, then you can copy and paste each piece of code into the cells of the new notebook.
-
To run each cell, click on the play button at the left edge of the cell or press Ctrl+Enter (Cmd+Enter on Mac).
-
You may need to install some required libraries, which can be done using "!pip install" commands. If you aren't sure what libraries or dependencies you need, refer to the instructions in the repository or code you're using.
-
It's important to note that you'll need to mount your Google Drive to save and load data. You can do this by adding the following commands at the beginning of your code:
from google.colab import drive
drive.mount('/content/drive')
After running these commands, click on the displayed link to authorize access, copy the authentication code, and paste it back into the input box in the notebook.
Limitations for free users:
-
GPUs and TPUs: Free users on Google Colab have access to GPUs and TPUs, but there are certain quotas for usage, which may result in slower access or unavailability during peak usage hours. Additionally, the free tier only includes K80, P4, and T4 GPU types, whereas Colab Pro offers P100 and V100 GPUs.
-
Runtime: Google Colab provides a maximum of 12 hours of continuous runtime per session for free users. After 12 hours, your runtime will be disconnected and you might lose any unsaved work.
-
Idle time: Your runtime may also be disconnected due to idle time (90 minutes). Make sure to save your work frequently to avoid losing data.
-
Resource availability: Colab prioritizes resources for its paid users, so you might experience limitations on the availability of GPUs and may have to wait for resources to become available during peak usage.
-
Storage: Colab gives 5GB of storage space with Google Drive. If you need more space, you can upgrade to Google One storage or subscribe to Colab Pro.
Remember that these limitations apply to Google Colab's free tier. If you require more resources or longer runtimes, consider upgrading to Colab Pro for a monthly fee.