The goal of this repository is to provide a Colab notebook to run the text-to-image "Stable Diffusion" model [1].
To remove the safety check, switch remove_safety
to True
:
remove_safety = True
A scheduler [2] can be chosen among:
- PNDM, which is the default scheduler in 🤗's D🧨iffusers for Stable Diffusion,
- DDIM,
- K-LMS, which is the scheduler suggested by DreamStudio.
Typically, parameters are set with the following ranges in mind:
num_images
(default:1
), between1
and4
,guidance_scale
(default:7.5
), between0
and20
,num_inference_steps
(default:50
), between10
and150
.
To be able to run the notebook, a "HuggingFace🤗 Hub token" is mandatory. This token is personal!
In order to obtain such token, you need to accept a "CreativeML OpenRAIL-M license", which explicitly states that:
You cannot use the model to deliberately produce nor share illegal or harmful outputs or content.
Moreover, as for the DALL·E model, you are asked to abide to the following statement:
Do not create or disseminate images that create hostile or alienating environments for people. This includes images that people would find disturbing, distressing, or offensive; or content that propagates stereotypes.
[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)