lambda/stable-diffusion-image-conditioned
66
1---2thumbnail: "https://repository-images.githubusercontent.com/523487884/fdb03a69-8353-4387-b5fc-0d85f888a63f"3datasets:4- ChristophSchuhmann/improved_aesthetics_6plus5license: other6tags:7- stable-diffusion8- stable-diffusion-diffusers9- image-to-image10---11 12# Stable Diffusion Image Variations Model Card13 14This version of Stable Diffusion has been fine tuned from [CompVis/stable-diffusion-v1-3-original](https://huggingface.co/CompVis/stable-diffusion-v-1-3-original) to accept CLIP image embedding rather than text embeddings. This allows the creation of "image variations" similar to DALLE-2 using Stable Diffusion. 15 1617 18## Example19 20To use this model requires a fork of the Stable Diffusion repo: [justinpinkney/stable-diffusion](https://github.com/justinpinkney/stable-diffusion)21 22```bash23git clone https://github.com/justinpinkney/stable-diffusion.git24cd stable-diffusion25mkdir -p models/ldm/stable-diffusion-v126wget https://huggingface.co/lambdalabs/stable-diffusion-image-conditioned/resolve/main/sd-clip-vit-l14-img-embed_ema_only.ckpt -O models/ldm/stable-diffusion-v1/sd-clip-vit-l14-img-embed_ema_only.ckpt27pip install -r requirements.txt28python scripts/gradio_variations.py29```30 31For the version ported to huggingface Diffusers, see [this model](https://huggingface.co/lambdalabs/sd-image-variations-diffusers).32 33# Training34 35**Training Data**36The model developers used the following dataset for training the model:37 38- LAION-2B (en) and subsets thereof (see next section)39 40**Training Procedure**41This model is fine tuned from Stable Diffusion v1-3 where the text encoder has been replaced with an image encoder. The training procedure is the same as for Stable Diffusion except for the fact that images are encoded through a ViT-L/14 image-encoder including the final projection layer to the CLIP shared embedding space.42 43- **Hardware:** 4 x A6000 GPUs (provided by [Lambda GPU Cloud](https://lambdalabs.com/service/gpu-cloud))44- **Optimizer:** AdamW45- **Gradient Accumulations**: 146- **Steps**: 87,00047- **Batch:** 6 x 4 = 2448- **Learning rate:** warmup to 0.0001 for 1,000 steps and then kept constant49 50Training was done using a [modified version of the original Stable Diffusion training code]((https://github.com/justinpinkney/stable-diffusion)51 52 53# Uses54_The following section is adapted from the [Stable Diffusion model card](https://huggingface.co/CompVis/stable-diffusion-v1-4)_55 56## Direct Use 57The model is intended for research purposes only. Possible research areas and58tasks include59 60- Safe deployment of models which have the potential to generate harmful content.61- Probing and understanding the limitations and biases of generative models.62- Generation of artworks and use in design and other artistic processes.63- Applications in educational or creative tools.64- Research on generative models.65 66Excluded uses are described below.67 68 ### Misuse, Malicious Use, and Out-of-Scope Use69 70The 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.71 72#### Out-of-Scope Use73The 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.74 75#### Misuse and Malicious Use76Using the model to generate content that is cruel to individuals is a misuse of this model. This includes, but is not limited to:77 78- Generating demeaning, dehumanizing, or otherwise harmful representations of people or their environments, cultures, religions, etc.79- Intentionally promoting or propagating discriminatory content or harmful stereotypes.80- Impersonating individuals without their consent.81- Sexual content without consent of the people who might see it.82- Mis- and disinformation83- Representations of egregious violence and gore84- Sharing of copyrighted or licensed material in violation of its terms of use.85- Sharing content that is an alteration of copyrighted or licensed material in violation of its terms of use.86 87## Limitations and Bias88 89### Limitations90 91- The model does not achieve perfect photorealism92- The model cannot render legible text93- 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”94- Faces and people in general may not be generated properly.95- The model was trained mainly with English captions and will not work as well in other languages.96- The autoencoding part of the model is lossy97- The model was trained on a large-scale dataset98 [LAION-5B](https://laion.ai/blog/laion-5b/) which contains adult material99 and is not fit for product use without additional safety mechanisms and100 considerations.101- No additional measures were used to deduplicate the dataset. As a result, we observe some degree of memorization for images that are duplicated in the training data.102 The training data can be searched at [https://rom1504.github.io/clip-retrieval/](https://rom1504.github.io/clip-retrieval/) to possibly assist in the detection of memorized images.103 104### Bias105 106While the capabilities of image generation models are impressive, they can also reinforce or exacerbate social biases. 107Stable Diffusion v1 was trained on subsets of [LAION-2B(en)](https://laion.ai/blog/laion-5b/), 108which consists of images that are primarily limited to English descriptions. 109Texts and images from communities and cultures that use other languages are likely to be insufficiently accounted for. 110This affects the overall output of the model, as white and western cultures are often set as the default. Further, the 111ability of the model to generate content with non-English prompts is significantly worse than with English-language prompts.112 113*This model card was written by: Justin Pinkney and is based on the [Stable Diffusion model card](https://huggingface.co/CompVis/stable-diffusion-v1-4).*