replicate.com Open in urlscan Pro
2606:4700:20::ac43:4557  Public Scan

URL: https://replicate.com/stability-ai/stable-diffusion
Submission: On April 02 via manual from RE — Scanned from DE

Form analysis 1 forms found in the DOM

#

<form action="#" novalidate="">
  <div class="mb-lh"><label for="input-prompt" class="block mb-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
        class="inline-block mr-2 w-3 h-3" role="presentation">
        <polyline points="4 7 4 4 20 4 20 7"></polyline>
        <line x1="9" y1="20" x2="15" y2="20"></line>
        <line x1="12" y1="4" x2="12" y2="20"></line>
      </svg><code>prompt</code></label>
    <div><textarea class="form-input w-full resize-none" name="prompt" style="height: 50px !important;">an astronaut riding a horse on mars artstation, hd, dramatic lighting, detailed</textarea></div>
    <p class="text-shade mt-1">Input prompt</p>
  </div>
  <div class="mb-lh"><label for="input-image_dimensions" class="block mb-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
        stroke-linejoin="round" class="inline-block mr-2 w-3 h-3" role="presentation">
        <line x1="8" y1="6" x2="21" y2="6"></line>
        <line x1="8" y1="12" x2="21" y2="12"></line>
        <line x1="8" y1="18" x2="21" y2="18"></line>
        <line x1="3" y1="6" x2="3.01" y2="6"></line>
        <line x1="3" y1="12" x2="3.01" y2="12"></line>
        <line x1="3" y1="18" x2="3.01" y2="18"></line>
      </svg><code>image_dimensions</code></label><select name="image_dimensions" id="input-image_dimensions" class="form-select w-full">
      <option value=""></option>
      <option value="512x512">512x512</option>
      <option value="768x768">768x768</option>
    </select>
    <p class="text-shade mt-1">pixel dimensions of output image</p>
  </div>
  <div class="mb-lh"><label for="input-negative_prompt" class="block mb-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
        stroke-linejoin="round" class="inline-block mr-2 w-3 h-3" role="presentation">
        <polyline points="4 7 4 4 20 4 20 7"></polyline>
        <line x1="9" y1="20" x2="15" y2="20"></line>
        <line x1="12" y1="4" x2="12" y2="20"></line>
      </svg><code>negative_prompt</code></label>
    <div><textarea class="form-input w-full resize-none" name="negative_prompt" style="height: 50px !important;"></textarea></div>
    <p class="text-shade mt-1">Specify things to not see in the output</p>
  </div>
  <div class="mb-lh"><label for="input-num_outputs" class="block mb-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
        stroke-linejoin="round" class="inline-block mr-2 w-3 h-3" role="presentation">
        <line x1="4" y1="9" x2="20" y2="9"></line>
        <line x1="4" y1="15" x2="20" y2="15"></line>
        <line x1="10" y1="3" x2="8" y2="21"></line>
        <line x1="16" y1="3" x2="14" y2="21"></line>
      </svg><code>num_outputs</code></label>
    <fieldset id="input-num_outputs" class="flex">
      <legend hidden="">num_outputs</legend><input type="number" aria-label="num_outputs" min="1" max="4" name="num_outputs" step="1" class="flex-none w-20 p-05lh mr-05lh border-shade border focus:outline-none focus:border-black;" value="1"><input
        type="range" aria-label="num_outputs" min="1" max="4" name="num_outputs" step="1" class="flex-grow" value="1">
    </fieldset>
    <p class="text-shade mt-1">Number of images to output. (minimum: 1; maximum: 4) </p>
  </div>
  <div class="mb-lh"><label for="input-num_inference_steps" class="block mb-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
        stroke-linejoin="round" class="inline-block mr-2 w-3 h-3" role="presentation">
        <line x1="4" y1="9" x2="20" y2="9"></line>
        <line x1="4" y1="15" x2="20" y2="15"></line>
        <line x1="10" y1="3" x2="8" y2="21"></line>
        <line x1="16" y1="3" x2="14" y2="21"></line>
      </svg><code>num_inference_steps</code></label>
    <fieldset id="input-num_inference_steps" class="flex">
      <legend hidden="">num_inference_steps</legend><input type="number" aria-label="num_inference_steps" min="1" max="500" name="num_inference_steps" step="1"
        class="flex-none w-20 p-05lh mr-05lh border-shade border focus:outline-none focus:border-black;" value="50"><input type="range" aria-label="num_inference_steps" min="1" max="500" name="num_inference_steps" step="1" class="flex-grow"
        value="50">
    </fieldset>
    <p class="text-shade mt-1">Number of denoising steps (minimum: 1; maximum: 500) </p>
  </div>
  <div class="mb-lh"><label for="input-guidance_scale" class="block mb-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
        stroke-linejoin="round" class="inline-block mr-2 w-3 h-3" role="presentation">
        <line x1="4" y1="9" x2="20" y2="9"></line>
        <line x1="4" y1="15" x2="20" y2="15"></line>
        <line x1="10" y1="3" x2="8" y2="21"></line>
        <line x1="16" y1="3" x2="14" y2="21"></line>
      </svg><code>guidance_scale</code></label>
    <fieldset id="input-guidance_scale" class="flex">
      <legend hidden="">guidance_scale</legend><input type="number" aria-label="guidance_scale" min="1" max="20" name="guidance_scale" step="0.01" class="flex-none w-20 p-05lh mr-05lh border-shade border focus:outline-none focus:border-black;"
        value="7.5"><input type="range" aria-label="guidance_scale" min="1" max="20" name="guidance_scale" step="0.01" class="flex-grow" value="7.5">
    </fieldset>
    <p class="text-shade mt-1">Scale for classifier-free guidance (minimum: 1; maximum: 20) </p>
  </div>
  <div class="mb-lh"><label for="input-scheduler" class="block mb-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
        class="inline-block mr-2 w-3 h-3" role="presentation">
        <line x1="8" y1="6" x2="21" y2="6"></line>
        <line x1="8" y1="12" x2="21" y2="12"></line>
        <line x1="8" y1="18" x2="21" y2="18"></line>
        <line x1="3" y1="6" x2="3.01" y2="6"></line>
        <line x1="3" y1="12" x2="3.01" y2="12"></line>
        <line x1="3" y1="18" x2="3.01" y2="18"></line>
      </svg><code>scheduler</code></label><select name="scheduler" id="input-scheduler" class="form-select w-full">
      <option value=""></option>
      <option value="DDIM">DDIM</option>
      <option value="K_EULER">K_EULER</option>
      <option value="DPMSolverMultistep">DPMSolverMultistep</option>
      <option value="K_EULER_ANCESTRAL">K_EULER_ANCESTRAL</option>
      <option value="PNDM">PNDM</option>
      <option value="KLMS">KLMS</option>
    </select>
    <p class="text-shade mt-1">Choose a scheduler.</p>
  </div>
  <div class="mb-lh"><label for="input-seed" class="block mb-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
        class="inline-block mr-2 w-3 h-3" role="presentation">
        <line x1="4" y1="9" x2="20" y2="9"></line>
        <line x1="4" y1="15" x2="20" y2="15"></line>
        <line x1="10" y1="3" x2="8" y2="21"></line>
        <line x1="16" y1="3" x2="14" y2="21"></line>
      </svg><code>seed</code></label><input name="seed" type="number" id="input-seed" step="1" class="form-input w-full" value="">
    <p class="text-shade mt-1">Random seed. Leave blank to randomize the seed</p>
  </div><button class="form-button mr-2 relative" type="submit"><span class="">Submit</span></button><button class="form-button-secondary" type="button">Reset</button>
</form>

Text Content

Explore Pricing Docs Blog Changelog Sign in Get started
Explore Pricing Docs Blog Changelog Sign in Get started
🚀 Want to run this model with an API? Get started



STABILITY-AI/STABLE-DIFFUSION

Public
A latent text-to-image diffusion model capable of generating photo-realistic
images given any text input
84M runs
GitHub
Paper
License
Demo API Examples Versions (db21e45d)

INPUT

prompt
an astronaut riding a horse on mars artstation, hd, dramatic lighting, detailed

Input prompt

image_dimensions512x512768x768

pixel dimensions of output image

negative_prompt


Specify things to not see in the output

num_outputsnum_outputs

Number of images to output. (minimum: 1; maximum: 4)

num_inference_stepsnum_inference_steps

Number of denoising steps (minimum: 1; maximum: 500)

guidance_scaleguidance_scale

Scale for classifier-free guidance (minimum: 1; maximum: 20)

schedulerDDIMK_EULERDPMSolverMultistepK_EULER_ANCESTRALPNDMKLMS

Choose a scheduler.

seed

Random seed. Leave blank to randomize the seed

SubmitReset

OUTPUT


Share
Download
Report
Show logs

EXAMPLES

View more examples



RUN TIME AND COST

Predictions run on Nvidia A100 GPU hardware. Predictions typically complete
within 3 seconds.

README

Stable Diffusion is a latent text-to-image diffusion model capable of generating
photo-realistic images given any text input.

We’ve generated a version of stable diffusion which runs very fast, but can only
produce 512x512 or 768x768 images. We’ll keep hosting versions of stable
diffusion which generate variable-sized images, so don’t worry if you need
variable dimensions. Here's a quick guide:

Stable Diffusion Version Optimized for speed, fixed image sizes Flexible image
size 2.1 link link 1.5 link link

See the list of stable diffusion versions for further details:
https://replicate.com/stability-ai/stable-diffusion/versions

 * Developed by: Robin Rombach, Patrick Esser
 * Model type: Diffusion-based text-to-image generation model
 * Language(s): English
 * License: The CreativeML OpenRAIL M license is an Open RAIL M license, adapted
   from the work that BigScience and the RAIL Initiative are jointly carrying in
   the area of responsible AI licensing. See also the article about the BLOOM
   Open RAIL license on which our license is based.
 * 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 (CLIP ViT-L/14) as suggested in the Imagen
   paper.
 * Resources for more information: GitHub Repository, Paper.
 * Cite as:

@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}
      }


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 taken from the DALLE-MINI model card, but applies in the
same way to Stable Diffusion v1.

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 large-scale dataset
   LAION-5B which contains adult material
   and is not fit for product use without additional safety mechanisms and
   considerations.
 * 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.
   The training data can be searched at
   https://rom1504.github.io/clip-retrieval/ to possibly assist in the detection
   of memorized images.


BIAS

While the capabilities of image generation models are impressive, they can also
reinforce or exacerbate social biases.
Stable Diffusion v1 was trained on subsets of LAION-2B(en),
which consists of images that are primarily 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.


TRAINING

Training Data
The model developers used the following dataset for training the model:

 * LAION-2B (en) and subsets thereof (see next section)

Training Procedure
Stable Diffusion v1 is a latent diffusion model which combines an autoencoder
with a diffusion model that is trained in the latent space of the autoencoder.
During training,

 * Images are encoded through an encoder, which turns images into latent
   representations. The autoencoder uses a relative downsampling factor of 8 and
   maps images of shape H x W x 3 to latents of shape H/f x W/f x 4
 * 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 of
   the latent diffusion model via cross-attention.
 * The loss is a reconstruction objective between the noise that was added to
   the latent and the prediction made by the UNet.

We currently provide three checkpoints, sd-v1-1.ckpt, sd-v1-2.ckpt and
sd-v1-3.ckpt,
which were trained as follows,

 * sd-v1-1.ckpt: 237k steps at resolution 256x256 on laion2B-en.
   194k steps at resolution 512x512 on laion-high-resolution (170M examples from
   LAION-5B with resolution >= 1024x1024).
 * sd-v1-2.ckpt: Resumed from sd-v1-1.ckpt.
   515k steps at resolution 512x512 on "laion-improved-aesthetics" (a subset of
   laion2B-en,
   filtered to images with an original size >= 512x512, estimated aesthetics
   score > 5.0, and an estimated watermark probability < 0.5. The watermark
   estimate is from the LAION-5B metadata, the aesthetics score is estimated
   using an improved aesthetics estimator).

 * sd-v1-3.ckpt: Resumed from sd-v1-2.ckpt. 195k steps at resolution 512x512 on
   "laion-improved-aesthetics" and 10\% dropping of the text-conditioning to
   improve classifier-free guidance sampling.

 * 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 PLMS sampling
steps show the relative improvements of the checkpoints:



Evaluated using 50 PLMS steps and 10000 random prompts from the COCO2017
validation set, evaluated at 512x512 resolution. Not optimized for FID scores.


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: 150000
 * Cloud Provider: AWS
 * Compute Region: US-east
 * Carbon Emitted (Power consumption x Time x Carbon produced based on location
   of power grid): 11250 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}
    }

This model card was written by: Robin Rombach and Patrick Esser and is based on
the DALL-E Mini model card.

Replicate
Home About Docs Terms Privacy GitHub Twitter Discord Email