Stable Diffusion is a diffusion-based text-to-image generation model capable of generating photorealistic images from arbitrary text input. The model was developed by Robin Rombach and Patrick Esser, uses a latent diffusion model architecture, and employs a fixed pretrained text encoder, CLIP ViT-L/14. The model supports versions 1.5 and 2.1 and is available via API on the Replicate platform.\n\nKey capabilities: generate and modify images from text prompts; generate images of dynamic sizes up to 1024x1024 (fast version); support English prompts.\n\nUsage: can be called via the Replicate API, with a running cost of approximately $0.012 per run (about 83 runs per $1), with actual costs varying by input; it can also be run open-source on your own computer via Docker. The model runs on Nvidia A100 (80GB) GPU hardware, and predictions typically complete within 9 seconds.\n\nApplicable scenarios: this model is for research use only; possible research areas and tasks include: safe deployment of models that may generate harmful content; investigating and understanding the limitations and biases of generative models; generating artworks and using them in artistic processes such as design; application in educational or creative tools; research on generative models.\n\nLimitations: the model cannot achieve perfect photorealism; it cannot render legible text; it performs poorly on more difficult tasks involving compositionality (e.g., rendering "a red cube on top of a blue sphere"); faces and people may often be generated incorrectly; it was trained primarily on English captions, so other languages perform worse; the autoencoding part is lossy; the training data LAION-5B contains adult content and is not suitable for product use without additional safety mechanisms; the dataset was not deduplicated, resulting in a certain degree of memorization of duplicate images in the training data; the model may reinforce or exacerbate social biases, the training data is mainly limited to English descriptions, content from non-English communities and cultures may be insufficient, and the model's ability to generate content for non-English prompts is significantly worse than for English prompts.\n\nTraining data: LAION-2B (en) and its subsets. Training process: Stable Diffusion v1 is a latent diffusion model that combines an autoencoder with a diffusion model trained in the autoencoder's latent space. Images are converted to latent representations by the encoder; the autoencoder uses a relative downsampling factor of 8, mapping an H x W x 3 image to an H/f x W/f x 4 latent representation; text prompts are processed through Encoded by the ViT-L/14 text encoder; the non-pooled output of the text encoder is fed into the UNet backbone of the latent diffusion model via cross-attention; the loss is the reconstruction objective between the noise added to the latent representation and the UNet prediction. Three checkpoints are provided: sd-v1-1.ckpt, sd-v1-2.ckpt, and sd-v1-3.ckpt. Hardware: 32 x 8 x A100 GPUs; optimizer: AdamW; gradient accumulation: 2; batch: 32 x 8 x 2 x 4 = 2048; learning rate: warmed up to 0.0001 for 10,000 steps, then held constant.
Evaluation results: evaluated with different classifier-free guidance scales (1.5, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0) and 50 PLMS sampling steps on 10000 random prompts from the COCO2017 validation set at 512x512 resolution, not optimized for FID score.
Environmental impact: based on A100 PCIe 40GB hardware, 150000 hours of usage, AWS cloud provider, US East computing region, estimated carbon emissions are 11250 kg CO2 equivalent.
License: CreativeML OpenRAIL M license.