The minimal Stable Diffusion code below is adapted for free use. Google Colab may prompt that the notebook requires high RAM. Minimal code does not exceed RAM allocations, although expanding processes may exceed free resource allocations.
How to run Stable Diffusion code within Google Colab:
Create a Huggingface account
1. Accept the terms of service for the stable-diffusion-v1-4
2. Access your Huggingface token
Open Google Colab and run each cell sequentially (Google Colab is installing packages and library requirements for functionality.)
1. After installation, authenticate your Huggingface login with the token mentioned in 1.1
2. Run the final cell and enter desired prompt for Stable Diffusion
The code above is the minimal way to use Stable Diffusion API in Google Colab. Advanced technologies can be built upon this code, such as web applications using gradio or automated post-processing that enhance desirable effects. Advanced documentation is provided by Huggingface at https://github.com/huggingface/diffusers.
In depth documentation of Stable Diffusion and Google Colab is available at https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/stable_diffusion.ipynb