Stable-Diffusion-Colab
The goal of this repository is to provide a Colab notebook to run the text-to-image "Stable Diffusion" model [1].
Usage
Schedulers
A scheduler [2] can be chosen among:
- PNDM, which is the default scheduler in 🤗's D🧨iffusers for Stable Diffusion at 512 resolution,
- DDIM, which is the default scheduler in 🤗 for Stable Diffusion at 768 resolution,
- K-LMS, which is the scheduler suggested by DreamStudio.
- Euler, which is the scheduler used in 🤗's example for Stable Diffusion 2.
- DPM, which is the scheduler used in 🤗's example for Stable Diffusion 2.1.
Safety Check
To remove the safety check, switch remove_safety
to True
:
remove_safety = True
Parameters
Typically, parameters are set with the following ranges in mind:
num_images
(default:4
), between1
and4
,guidance_scale
(default:9
), between0
and20
,num_inference_steps
(default:25
), between10
and150
.
Results Different results obtained with the text prompt: "a photo of an astronaut riding a horse on Mars".
Different results obtained with the text prompt: "a photo of an astronaut riding a horse on Mars" using Dreamlike Photoreal 2.0.
Different results obtained with the text prompt: "a photo of Pikachu fine dining with a view to the Eiffel Tower".
Different results obtained with the text prompt: "a photo of Pikachu fine dining with a view to the Eiffel Tower" using Dreamlike Photoreal 2.0.
References
[1] Rombach, Robin, et al. High-resolution image synthesis with latent diffusion models. CVPR 2022. (models & demo)
[2] Karras, Tero, et al. Elucidating the Design Space of Diffusion-Based Generative Models. NeurIPS 2022. (code)