Skip to content

Stable Diffusion

Ch. 1 of 7
— CH. 1 · INTRODUCTION —

Contents

Stable Diffusion

7 sections
  • Stable Diffusion arrived publicly in August 2022 with one property that separated it from every rival. Its code and model weights were free to download. The other leading text-to-image tools of that moment required users to generate images through cloud services. This one could run locally, on hardware most people already owned, without paying a subscription. The researchers who built it came from German university labs. The nonprofit that assembled its training data pulled from a vast archive of the public web. Almost immediately, the model's openness became the subject of lawsuits in two countries. The central argument was whether training an AI on billions of scraped images amounted to infringement. Those disputes raised a question the technology had outrun. When a machine learns from the work of human artists without their knowledge, who owns what it produces?

  • The technology underlying Stable Diffusion traces back to a project called Latent Diffusion. Researchers at LMU Munich and Heidelberg University developed it in Germany. Five authors produced the original work. Four of them, Robin Rombach, Andreas Blattmann, Patrick Esser, and Dominik Lorenz, later joined Stability AI and released subsequent versions of the model. Development was led by Rombach, of the CompVis group at LMU Munich, and Esser, of a company called Runway. Both had been among the inventors of the latent diffusion model architecture that Stable Diffusion would use.

    Diffusion models as a class had existed since 2015. Their name came from thermodynamics, which had inspired their earliest designs. The CompVis group developed a refinement called the latent diffusion model in 2021. Where earlier diffusion models worked directly on image pixels, this variant first compressed images into a smaller representational space. That compression made training and generation more efficient, which researchers identified as a key advantage.

    Stability AI provided a computational donation to the project. The company also credited two external organizations as supporters: EleutherAI and LAION, a German nonprofit that assembled the training data. The technical license for the model was released by the CompVis group at LMU Munich. The research paper describing the latent diffusion method was first published in 2021 and updated in 2022. It forms the backbone of the Stable Diffusion architecture.

  • LAION-5B, the dataset used to train Stable Diffusion, contained five billion image-text pairs drawn from Common Crawl data scraped from the web. LAION, the German nonprofit that assembled it, received funding from Stability AI. The pairs were filtered by language, by resolution, by the estimated probability of carrying a watermark, and by a predicted aesthetic score. A third-party analysis of a twelve-million-image sample found that approximately 47% of those images came from just 100 different domains. Pinterest alone accounted for 8.5% of that sample. Other large sources included WordPress, Blogspot, Flickr, DeviantArt, and Wikimedia Commons.

    Three subsets of LAION-5B formed the training basis. The final rounds focused on a subset called laion-aesthetics v2 5+, containing around 600 million captioned images. Each image in that subset had been evaluated by a tool called the LAION-Aesthetics Predictor V2. That tool predicted that a human rater would give the image a score of at least 5 out of 10. Images likely to carry watermarks and low-resolution images were excluded. During the final rounds, 10% of text conditioning was randomly dropped to improve a technique called Classifier-Free Diffusion Guidance. The training ran on 256 Nvidia A100 GPUs through Amazon Web Services, consuming 150,000 GPU-hours at a cost of $600,000.

    An investigation by Bayerischer Rundfunk found that LAION's datasets, hosted on Hugging Face, contained large amounts of private and sensitive data.

  • Stable Diffusion's U-Net, the component that performs the core denoising work, contains 860 million parameters. The text encoder carries 123 million. By 2022 standards, those figures made the model relatively lightweight. An optimized version could run on a consumer graphics card with as little as 2.4 gigabytes of VRAM. A version built on OpenVINO ran on a CPU alone.

    The primary generation mode is called txt2img. A user writes a text prompt; the model produces an image. Each generation involves a seed value, and reusing the same seed reproduces the same result. A guidance scale parameter controls how closely the output adheres to the prompt; higher values produce more literal interpretations. Generated images are tagged with an invisible digital watermark, though that watermark loses its effectiveness if the image is resized or rotated.

    A second script, called img2img, takes both a text prompt and an existing image as inputs. A strength value between 0.0 and 1.0 determines how much the model modifies the original. Inpainting let users paint a mask over a specific region; the model filled that area with new content based on the prompt. Outpainting extended an image beyond its original edges. A depth-guided extension called depth2img was released on the 24th of November 2022. It inferred the spatial depth of the input image to maintain coherence in the generated result. Researchers have also experimented with img2img for data anonymization, image upscaling, and image compression. The compression approach faces limitations in preserving small text and faces compared to JPEG and WebP.

    Initial training on 512-by-512 pixel images meant output quality degraded noticeably when users specified other dimensions. Human limbs and faces were poorly represented in the training data, and requests for full human figures often produced distorted hands. The model also could not generate legible ambigrams or most other forms of text and typography. Fine-tuning for anime character generation required a minimum of 30 gigabytes of VRAM. Cards in Nvidia's GeForce 30 series typically provide only about 12 gigabytes.

  • In 2022, researchers from Google Research and Boston University developed DreamBooth. It allowed users to fine-tune the model toward a specific subject using a small set of reference images. The result was a version of the model capable of generating that subject in new contexts and styles.

    A technique called textual inversion came from researchers at Tel Aviv University in 2022, with support from Nvidia. It trained an "embedding": a vector representation linked to a new pseudo-word. Using that word in a prompt would reliably produce a consistent visual concept. Embeddings could reduce biases in the original model or capture a particular visual style.

    A developer known as Kurumuz, who worked at NovelAI, created hypernetworks in 2021 as a technique originally intended for text-generation models. Hypernetworks are small pretrained neural networks applied to a larger model at specific points. They identify areas of visual importance, such as hair and eyes. Adjustments in a secondary latent space can steer the output toward a chosen style.

    ControlNet's defining feature was a split of a neural network's weights into a locked copy and a trainable copy. The locked copy preserved the original model; the trainable copy learned a new controlling condition. ControlNet used a technique called zero convolution, in which every weight and bias began at zero. This prevented new training from distorting the underlying model before it had learned anything. Common controlling inputs included depth maps, edge maps, and skeletal pose diagrams.

    ControlNet's design enabled fine-tuning to run on personal devices with small datasets. Stability AI used the same principle to release a dedicated inpainting model.

  • DreamStudio, Stability AI's cloud-based image-generation service, supported negative prompts that let users specify elements the model should avoid generating. Stability AI also published an open source version called StableStudio. Among third-party interfaces, AUTOMATIC1111 became the most widely used, offering additional features beyond the core model. Fooocus aimed to reduce the amount of prompting required. ComfyUI built the generation pipeline as a node-based visual interface, comparable in structure to software used in three-dimensional modeling.

    The model launched without a version 1.0. Versions 1.1 through 1.4 were released as an initial group by CompVis. Version 1.5 followed on the 20th of October 2022, released by RunwayML and initialized with the weights of version 1.2. Version 2.0 arrived in November 2022, retrained from scratch on a filtered dataset. Stable Diffusion XL 1.0 reached users in July 2023 with 3.5 billion parameters, roughly 3.5 times more than earlier versions. XL Turbo followed in November 2023, distilled from XL 1.0 to run in fewer diffusion steps. Stable Diffusion 3.0 arrived in early preview in February 2024, replacing the U-Net backbone with a Rectified Flow Transformer. Stable Diffusion 3.5 followed in October 2024 as a family of models. Large carried 8 billion parameters, Medium carried 2.5 billion, and Large Turbo was distilled from Large for faster generation.

    Prior to Stable Diffusion 3, the model applied a license called Creative ML OpenRAIL-M. That license prohibited uses including crime, harassment, doxing, and providing medical advice. Stable Diffusion 3.5 introduced a Community License for most users. Commercial organizations with annual revenue above one million dollars required a separate Enterprise License. Users retain the rights to their generated images and may use them commercially under either license. Stable Diffusion 3.5 Large became available through Amazon Bedrock for enterprise use. The training runs that built the original model had also run on Amazon Web Services.

Updated

Common questions

What is Stable Diffusion and how does it generate images?

Released in 2022, Stable Diffusion converts text prompts into images using a technique called latent diffusion. It compresses image data into a smaller representational space, applies Gaussian noise, then denoises the result guided by a text encoder. Its code and pretrained weights are publicly available, letting it run on consumer hardware with as little as 2.4 gigabytes of VRAM.

Who developed Stable Diffusion?

Stable Diffusion was developed by Robin Rombach of the CompVis group at LMU Munich and Patrick Esser of Runway, both of whom had previously invented the latent diffusion model architecture. Four of the five original researchers, including Rombach, Esser, Andreas Blattmann, and Dominik Lorenz, later joined Stability AI. LAION, a German nonprofit, assembled the training dataset.

How much did it cost to train Stable Diffusion?

Training the original Stable Diffusion model cost $600,000. The training ran on 256 Nvidia A100 GPUs through Amazon Web Services, consuming a total of 150,000 GPU-hours.

What are the copyright lawsuits involving Stable Diffusion?

In January 2023, artists Sarah Andersen, Kelly McKernan, and Karla Ortiz sued Stability AI, Midjourney, and DeviantArt for copyright infringement, alleging that AI tools were trained on images scraped from the web without creators' consent. Getty Images also initiated legal proceedings against Stability AI in the English High Court in January 2023, claiming unauthorized use of its images. As of the 4th of November 2025, Getty had largely lost that case.

Can Stable Diffusion run on a home computer without a cloud service?

Stable Diffusion runs locally on consumer graphics cards, unlike rivals such as DALL-E and Midjourney, which required cloud services. The recommended minimum is 10 gigabytes of VRAM, and an OpenVINO version can run on a CPU without any graphics card.

What dataset was Stable Diffusion trained on?

Stable Diffusion was trained on LAION-5B, a dataset of five billion image-text pairs assembled from Common Crawl data scraped from the web. The final training rounds used a filtered subset called laion-aesthetics v2 5+, containing around 600 million images predicted to score at least 5 out of 10 on an aesthetic rating. A third-party analysis of a twelve-million-image sample found that 47% of images came from just 100 domains, with Pinterest accounting for 8.5%.

All sources

98 references cited across the entry

  1. 7Stable Diffusion Repository on GitHubCompVis - Machine Vision and Learning Research Group, LMU Munich — 17 September 2022
  2. 11BookGenerative Deep LearningFoster David — O'Reilly
  3. 12Deep Unsupervised Learning using Nonequilibrium ThermodynamicsJascha Sohl-Dickstein, Eric A. Weiss, Niru Maheswaranathan, Surya Ganguli — 12 March 2015
  4. 17Scaling Rectified Flow Transformers for High-Resolution Image SynthesisPatrick Esser et al. — 2024-03-05
  5. 18Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified FlowXingchao Liu et al. — 2022-09-07
  6. 22We Are All Raw Material for AIKatharina Brunner et al. — Bayerischer Rundfunk (BR) — 2023-07-07
  7. 23CLIP+MLP Aesthetic Score PredictorChristoph Schuhmann — 2022-11-02
  8. 25Classifier-Free Diffusion GuidanceJonathan Ho et al. — 2022-07-25
  9. 26Cost of constructionEmad Mostaque — August 28, 2022
  10. 35Adapting Pretrained Vision-Language Foundational Models to Medical Imaging DomainsPierre Chambon et al. — 2022-10-09
  11. 37Waifu DiffusionAnthony Mercurio — 2022-10-31
  12. 41An Image is Worth One Word: Personalizing Text-to-Image Generation using Textual InversionRinon Gal et al. — 2022-08-02
  13. 44SDEdit: Guided Image Synthesis and Editing with Stochastic Differential EquationsChenlin Meng et al. — August 2, 2021
  14. 45Stable Diffusion web UI10 November 2022
  15. 46invisible-watermarkShield Mountain — 2022-11-02
  16. 49Boomerang: Local sampling on image manifolds using diffusion modelsLorenzo Luzi et al. — 2022-10-21
  17. 50Stable Diffusion Based Image CompressionMatthias Bühlmann — 2022-09-28
  18. 51Adding Conditional Control to Text-to-Image Diffusion ModelsLvmin Zhang — 10 February 2023
  19. 60ThesisLatent Auto-recursive Composition EngineYenkai Huang — Dartmouth College — 2024-05-10
  20. 61CompVis (CompVis)2023-08-23
  21. 68SDXL: Improving Latent Diffusion Models for High-Resolution Image SynthesisDustin Podell et al. — 2023-07-04
  22. 73Learning Transferable Visual Models From Natural Language SupervisionAlec Radford et al. — 2021-02-26
  23. 74SDEdit: Guided Image Synthesis and Editing with Stochastic Differential EquationsChenlin Meng et al. — 2022-01-04
  24. 75BookProceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)Robin Rombach et al. — 2022
  25. 94Community License2024-07-05

Queue