This model card focuses on the model associated with the Stable Diffusion v2-1 model, codebase available
here
.
This
stable-diffusion-2-1-unclip
is a finetuned version of Stable Diffusion 2.1, modified to accept (noisy) CLIP image embedding in addition to the text prompt, and can be used to create image variations (Examples) or can be chained with text-to-image CLIP priors. The amount of noise added to the image embedding can be specified via the noise_level (0 means no noise, 1000 full noise).
Model Description:
This is a model that can be used to generate and modify images based on text prompts. It is a
Latent Diffusion Model
that uses a fixed, pretrained text encoder (
OpenCLIP-ViT/H
).
@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}
}
Examples
Using the
🤗's Diffusers library
to run Stable Diffusion UnCLIP 2-1-small in a simple and efficient manner.
Running the pipeline (if you don't swap the scheduler it will run with the default DDIM, in this example we are swapping it to DPMSolverMultistepScheduler):
from diffusers import DiffusionPipeline
from diffusers.utils import load_image
import torch
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1-unclip-small", torch_dtype=torch.float16)
pipe.to("cuda")
# get image
url = "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png"
image = load_image(url)
# run image variation
image = pipe(image).images[0]
Uses
Direct Use
The model is intended for research purposes only. Possible research areas and tasks include
Safe deployment of models which have 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
Note: This section is originally taken from the
DALLE-MINI model card
, was used for Stable Diffusion v1, but applies in the same way to Stable Diffusion v2
.
The model should not be used to intentionally create or disseminate images that create hostile or alienating environments for people. This includes generating images that people would foreseeably find disturbing, distressing, or offensive; or content that propagates historical or current stereotypes.
Out-of-Scope Use
The model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.
Misuse and Malicious Use
Using the model to generate content that is cruel to individuals is a misuse of this model. This includes, but is not limited to:
Generating demeaning, dehumanizing, or otherwise 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
The model cannot render legible text
The model does not perform well on more difficult tasks which involve compositionality, such as rendering an image corresponding to “A red cube on top of a blue sphere”
Faces and people in general may not be generated properly.
The model was trained mainly with English captions and will not work as well in other languages.
The autoencoding part of the model is lossy
The model was trained on a subset of the large-scale dataset
LAION-5B
, which contains adult, violent and sexual content. To partially mitigate this, we have filtered the dataset using LAION's NFSW detector (see Training section).
Bias
While the capabilities of image generation models are impressive, they can also reinforce or exacerbate social biases.
Stable Diffusion was primarily trained on subsets of
LAION-2B(en)
,
which consists of images that are limited to English descriptions.
Texts and images from communities and cultures that use other languages are likely to be insufficiently accounted for.
This affects the overall output of the model, as white and western cultures are often set as the default. Further, the
ability of the model to generate content with non-English prompts is significantly worse than with English-language prompts.
Stable Diffusion v2 mirrors and exacerbates biases to such a degree that viewer discretion must be advised irrespective of the input or its intent.
Training
Training Data
The model developers used the following dataset for training the model:
LAION-5B and subsets (details below). The training data is further filtered using LAION's NSFW detector, with a "p_unsafe" score of 0.1 (conservative). For more details, please refer to LAION-5B's
NeurIPS 2022
paper and reviewer discussions on the topic.
Environmental Impact
Stable Diffusion v1
Estimated Emissions
Based on that information, we estimate the following CO2 emissions using the
Machine Learning Impact calculator
presented in
Lacoste et al. (2019)
. The hardware, runtime, cloud provider, and compute region were utilized to estimate the carbon impact.
Hardware Type:
A100 PCIe 40GB
Hours used:
200000
Cloud Provider:
AWS
Compute Region:
US-east
Carbon Emitted (Power consumption x Time x Carbon produced based on location of power grid):
15000 kg CO2 eq.
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}
}
stable-diffusion-2-1-unclip huggingface.co is an AI model on huggingface.co that provides stable-diffusion-2-1-unclip's model effect (), which can be used instantly with this stabilityai stable-diffusion-2-1-unclip model. huggingface.co supports a free trial of the stable-diffusion-2-1-unclip model, and also provides paid use of the stable-diffusion-2-1-unclip. Support call stable-diffusion-2-1-unclip model through api, including Node.js, Python, http.
stable-diffusion-2-1-unclip huggingface.co is an online trial and call api platform, which integrates stable-diffusion-2-1-unclip's modeling effects, including api services, and provides a free online trial of stable-diffusion-2-1-unclip, you can try stable-diffusion-2-1-unclip online for free by clicking the link below.
stabilityai stable-diffusion-2-1-unclip online free url in huggingface.co:
stable-diffusion-2-1-unclip is an open source model from GitHub that offers a free installation service, and any user can find stable-diffusion-2-1-unclip on GitHub to install. At the same time, huggingface.co provides the effect of stable-diffusion-2-1-unclip install, users can directly use stable-diffusion-2-1-unclip installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
stable-diffusion-2-1-unclip install url in huggingface.co: