Model Overview
Model Features
Model Capabilities
Use Cases
๐ Stable Diffusion v1-5 Model Card
Stable Diffusion v1-5 is a latent text-to-image diffusion model. It can generate photo-realistic images from any text input. This model's weights have been converted to Core ML for Apple Silicon hardware, and there are 4 variants available.
๐ Quick Start
This model was generated by Hugging Face using Appleโs repository which has ASCL.
Stable Diffusion is capable of generating photo-realistic images given any text input. For more information, please have a look at ๐ค's Stable Diffusion blog.
The Stable-Diffusion-v1-5 checkpoint was initialized with the weights of the Stable-Diffusion-v1-2 checkpoint and fine-tuned on 595k steps at resolution 512x512 on "laion-aesthetics v2 5+" with 10% dropping of the text-conditioning to improve classifier-free guidance sampling.
These weights have been converted to Core ML for use on Apple Silicon hardware. There are 4 variants of the Core ML weights:
coreml-stable-diffusion-v1-5
โโโ original
โ โโโ compiled # Swift inference, "original" attention
โ โโโ packages # Python inference, "original" attention
โโโ split_einsum
โโโ compiled # Swift inference, "split_einsum" attention
โโโ packages # Python inference, "split_einsum" attention
Please refer to https://huggingface.co/blog/diffusers-coreml for details.
If you need weights for the ๐งจ Diffusers library, please visit this model instead.
โจ Features
- Text-to-Image Generation: Generate high-quality images based on text prompts.
- Core ML Compatibility: Converted to Core ML for use on Apple Silicon hardware.
- Multiple Variants: Four different variants of Core ML weights are available.
๐ Documentation
Model Details
Property | Details |
---|---|
Developed by | Robin Rombach, Patrick Esser |
Model Type | Diffusion-based text-to-image generation model |
Language(s) | English |
License | The CreativeML OpenRAIL M license, an Open RAIL M license, adapted from the work of BigScience and the RAIL Initiative. See also the article about the BLOOM Open RAIL license. |
Model Description | A model for generating and modifying images based on text prompts. It's a Latent Diffusion Model using a fixed, pretrained text encoder (CLIP ViT-L/14) as suggested in the Imagen paper. |
Resources for more information | GitHub Repository, Paper |
Uses
Direct Use
The model is for research purposes. Possible research areas and tasks include:
- Safe deployment of models with the potential to generate harmful content.
- Probing and understanding the limitations and biases of generative models.
- Generation of artworks and use in design and other artistic processes.
- Applications in educational or creative tools.
- Research on generative models.
Excluded uses are described below.
Misuse, Malicious Use, and Out-of-Scope Use
โ ๏ธ Important Note
This section is taken from the DALLE-MINI model card, but applies in the same way to Stable Diffusion.
The model should not be used to intentionally create or disseminate images that create hostile or alienating environments for people. This includes generating disturbing, distressing, offensive images or content that propagates stereotypes.
Out-of-Scope Use
The model was not trained to be factual or true representations of people or events, so using it to generate such content is out-of-scope.
Misuse and Malicious Use
Using the model to generate cruel content towards individuals is a misuse. This includes:
- Generating demeaning, dehumanizing, or harmful representations of people or their environments, cultures, religions, etc.
- Intentionally promoting or propagating discriminatory content or harmful stereotypes.
- Impersonating individuals without their consent.
- Sexual content without consent of the people who might see it.
- Mis- and disinformation
- Representations of egregious violence and gore
- Sharing of copyrighted or licensed material in violation of its terms of use.
- Sharing content that is an alteration of copyrighted or licensed material in violation of its terms of use.
Limitations and Bias
Limitations
- The model does not achieve perfect photorealism.
- It cannot render legible text.
- It performs poorly on difficult tasks involving compositionality.
- Faces and people may not be generated properly.
- It was trained mainly with English captions and works less well in other languages.
- The autoencoding part of the model is lossy.
- It was trained on a large-scale dataset LAION-5B which contains adult material and is not fit for product use without additional safety mechanisms.
- No additional measures were used to deduplicate the dataset, resulting in some memorization of duplicated images. The training data can be searched at https://rom1504.github.io/clip-retrieval/.
Bias
The model can reinforce or exacerbate social biases. It was trained on subsets of LAION-2B(en), mainly with English descriptions. Texts and images from non-English communities are insufficiently accounted for, affecting the overall output. The ability to generate content with non-English prompts is significantly worse.
Safety Module
The model is intended to be used with the Safety Checker in Diffusers. This checker compares model outputs against known hard-coded NSFW concepts in the embedding space of the CLIPTextModel
after image generation.
Training
Training Data
The model was trained on:
- LAION-2B (en) and subsets thereof.
Training Procedure
Stable Diffusion v1-5 is a latent diffusion model combining an autoencoder with a diffusion model trained in the autoencoder's latent space. During training:
- Images are encoded into latent representations by an encoder with a relative downsampling factor of 8.
- Text prompts are encoded through a ViT-L/14 text-encoder.
- The non-pooled output of the text encoder is fed into the UNet backbone via cross-attention.
- The loss is a reconstruction objective between the added noise and the UNet's prediction.
There are six Stable Diffusion checkpoints with different training procedures:
-
stable-diffusion-v1-1
: 237,000 steps at 256x256 on laion2B-en, 194,000 steps at 512x512 on laion-high-resolution. -
stable-diffusion-v1-2
: Resumed fromstable-diffusion-v1-1
, 515,000 steps at 512x512 on "laion-improved-aesthetics". -
stable-diffusion-v1-3
: Resumed fromstable-diffusion-v1-2
, 195,000 steps at 512x512 on "laion-improved-aesthetics" with 10% text-conditioning dropping. -
stable-diffusion-v1-4
: Resumed fromstable-diffusion-v1-2
, 225,000 steps at 512x512 on "laion-aesthetics v2 5+" with 10% text-conditioning dropping. -
stable-diffusion-v1-5
: Resumed fromstable-diffusion-v1-2
, 595,000 steps at 512x512 on "laion-aesthetics v2 5+" with 10% text-conditioning dropping. -
stable-diffusion-inpainting
: Resumed fromstable-diffusion-v1-5
, 440,000 steps of inpainting training at 512x512 on โlaion-aesthetics v2 5+โ with 10% text-conditioning dropping. -
Hardware: 32 x 8 x A100 GPUs
-
Optimizer: AdamW
-
Gradient Accumulations: 2
-
Batch: 32 x 8 x 2 x 4 = 2048
-
Learning rate: Warmup to 0.0001 for 10,000 steps and then kept constant
Evaluation Results
Evaluations with different classifier-free guidance scales (1.5, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0) and 50 PNDM/PLMS sampling steps show the relative improvements of the checkpoints:
Evaluated using 50 PLMS steps and 10000 random prompts from the COCO2017 validation set at 512x512 resolution. Not optimized for FID scores.
Environmental Impact
Stable Diffusion v1 Estimated Emissions
Based on the information, we estimate the CO2 emissions using the Machine Learning Impact calculator from Lacoste et al. (2019).
- Hardware Type: A100 PCIe 40GB
- Hours used: 150000
- Cloud Provider: AWS
- Compute Region: US-east
- Carbon Emitted: 11250 kg CO2 eq.
๐ License
This model is licensed under The CreativeML OpenRAIL M license.
๐ Citation
@InProceedings{Rombach_2022_CVPR,
author = {Rombach, Robin and Blattmann, Andreas and Lorenz, Dominik and Esser, Patrick and Ommer, Bj\"orn},
title = {High-Resolution Image Synthesis With Latent Diffusion Models},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2022},
pages = {10684-10695}
}
This model card was written by: Robin Rombach and Patrick Esser and is based on the DALL-E Mini model card.







