Artificial intelligence · Article
How AI Image Generation Works: Diffusion Models Explained
Published:
In brief
Tools such as DALL-E, Midjourney and Stable Diffusion create pictures using diffusion models: neural networks trained to turn an image into random noise and then reverse that process. To generate a new image, the network starts from pure noise and removes it step by step, guided by a text prompt, until a coherent picture appears.
Several AI image generators that emerged from 2022 onward — including OpenAI's DALL-E 2, Midjourney and Stability AI's Stable Diffusion — are built on a technique called diffusion. Rather than drawing an image stroke by stroke, these systems learn to reverse a mathematical process that gradually destroys an image with noise, then run that process backward starting from random static.
The core idea: learning to undo noise
Diffusion models for image generation were formalized in a 2020 paper, 'Denoising Diffusion Probabilistic Models,' by Jonathan Ho, Ajay Jain and Pieter Abbeel, posted on the research repository arXiv. The method, described as inspired by non-equilibrium thermodynamics, works in two stages. In the 'forward' stage, used only during training, small amounts of random (Gaussian) noise are added to a real photo over many steps until the image becomes indistinguishable from static. In the 'reverse' stage, a neural network is trained to predict and subtract that noise, step by step, until the original image is recovered.
Once trained, the network no longer needs a real photo to start from. It can begin with a canvas of pure random noise and run the same denoising steps it learned during training, producing a brand-new image that did not exist before. The 2020 paper reported that on a dataset called CIFAR-10 its model reached strong image-quality scores and, on larger 256x256 images, matched the sample quality of ProgressiveGAN, an earlier generative technique based on a different architecture.
Where the neural network does the work: U-Net and text guidance
The network that performs the denoising is typically a U-Net, a type of architecture that shrinks an image down to capture overall structure and then rebuilds it back up to full resolution. In Stable Diffusion's own technical documentation on GitHub, the model is described as using an 860-million-parameter U-Net to run the diffusion process, together with a separate autoencoder that compresses images into a smaller mathematical representation and decompresses the result back into a full image.
To follow a written prompt, the system needs a way to connect words to pixels. According to the same Stable Diffusion documentation, the model uses a frozen CLIP ViT-L/14 text encoder — a component trained separately to match text and images — to turn a prompt into a numerical representation that guides each denoising step, so the network removes noise in a way that steers the emerging image toward what the words describe.
- Training: real images are progressively corrupted with random noise over many steps until only static remains.
- Learning: a U-Net neural network is trained to predict and remove the noise added at each step.
- Text conditioning: a separate text encoder (such as CLIP) turns a prompt into a numerical guide for the denoising network.
- Generation: starting from random noise, the trained network removes noise step by step, guided by the text, until an image appears.
- Decoding (latent models only): a compressed internal representation is converted back into a full-resolution image.
Pixel space versus latent space: why Stable Diffusion runs on a laptop
Not all diffusion models work the same way internally. According to a December 2022 MIT Technology Review account of the technology's rise, DALL-E 2 performs its noise-removal process directly on full-resolution image pixels, while Stable Diffusion instead works on a compressed, 'latent' representation of the image inside the neural network — an approach the outlet says let Stable Diffusion run on ordinary personal computers rather than requiring large server infrastructure.
If you do this a thousand times, eventually the image looks like you have plucked the antenna cable from your TV set—it's just snow.
The GitHub repository for Stable Diffusion, maintained by the CompVis research group with Stability AI and Runway, states the model's latent diffusion approach was built on the group's earlier paper, 'High-Resolution Image Synthesis with Latent Diffusion Models,' presented at the CVPR 2022 computer-vision conference, and was trained on images from the LAION-5B dataset.
How the major diffusion-based image generators compare
| Model | Organization | Launched | Noise-removal space |
|---|---|---|---|
| DALL-E 2 | OpenAI | April 2022 | Full image pixels |
| Imagen / Parti | Announced May 2022; not released to the public at that time, per MIT Technology Review | Not detailed in sources reviewed | |
| Midjourney | Midjourney, Inc. | Summer 2022, per MIT Technology Review | Not detailed in sources reviewed |
| Stable Diffusion | CompVis / Stability AI / Runway | August 2022 | Compressed latent representation |
MIT Technology Review reported that DALL-E 2 reached one million users within about two and a half months of its April 2022 launch, and that Stable Diffusion's DreamStudio service passed one million users in under half that time after its August 2022 release — figures the outlet cited as evidence of how quickly the diffusion approach reached a mass audience that year.
What the 2020–2022 research established
The underlying mechanism — noise added during training, noise removed during generation, guided by a text encoder — formed the basis of the major image generators that emerged in 2022, as described in the 2020 paper by Ho, Jain and Abbeel and the 2022 reporting and documentation reviewed here. Individual companies have since layered additional components, such as larger U-Nets, bigger text encoders or prompt-rewriting systems, on top of this same diffusion framework.
Questions
- What is a diffusion model in simple terms?
- It is a neural network trained to reverse a process that gradually buries a real image under random noise; once trained, it can start from pure noise and remove it step by step to build a new image, as described in the 2020 paper 'Denoising Diffusion Probabilistic Models' by Ho, Jain and Abbeel.
- What is the difference between DALL-E 2 and Stable Diffusion?
- According to MIT Technology Review, DALL-E 2 removes noise directly on full-resolution image pixels, while Stable Diffusion removes noise from a compressed 'latent' representation of the image, which Stability AI's GitHub documentation says allows it to run on consumer GPUs rather than large server infrastructure.
- How does a text prompt actually steer image generation?
- Per Stable Diffusion's GitHub documentation, a separate component called a text encoder (CLIP ViT-L/14 in that model) converts the prompt into a numerical representation that the denoising network consults at every step, pushing the emerging image toward what the words describe.
- When did diffusion-based image generators become available in 2022?
- MIT Technology Review documents a 2022 timeline: DALL-E 2 launched in April; Google announced Imagen and Parti in May without releasing them publicly; Midjourney launched in the summer; and the open-source Stable Diffusion launched in August.
- What is a U-Net and why do diffusion models use it?
- A U-Net is the neural-network architecture that performs the step-by-step noise removal; Stable Diffusion's own technical documentation describes its version as an 860-million-parameter U-Net working alongside an autoencoder that compresses and decompresses the image.
Sources
This piece was prepared with artificial intelligence and passed an automated source check before publication. If you see an error, ask for a correction. Request a correction or reply · How we make this
Related

Artificial intelligenceArticle
How AI Algorithms Develop Bias, and What Safeguards Exist to Stop It
AI systems become biased when they learn from unrepresentative training data or encode human and institutional assumptions built into their design. Documented cases — an Amazon hiring tool and the 2018 "Gender Shades" facial-recognition study — show this can disadvantage women and people with darker skin. Regulators in the EU and standards bodies like NIST now require bias testing for high-risk systems.
Artificial intelligenceComparison
ChatGPT vs Claude vs Gemini in October 2026: models, prices and benchmarks compared
As of October 2026, ChatGPT runs on OpenAI's GPT-6 family (Astra for reasoning, Sol/Luna for everyday chat), Claude's flagship is Anthropic's Opus 5, and Google's generally available top model is Gemini 3.1 Pro while the newer Gemini 4 Argon is still in limited rollout. Entry-level paid plans cluster around $20 a month, but the three diverge sharply on context window, API cost and which benchmarks each company highlights.

Artificial intelligenceArticle
How AI Learns From Data: Training Explained Amid Meta's Scraping Clause Row
AI models learn by processing huge volumes of text, images or other data and adjusting internal parameters until their predictions match correct answers, repeated across billions of examples. Where that data comes from became a flashpoint in October 2026, when Meta's new commercial terms appeared to let it scrape business customers' websites for AI training, drawing criticism from publishers and legal scholars before Meta narrowed the wording.

Artificial intelligenceArticle
How AI Is Changing Diagnosis, Drug Discovery and Patient Care in 2026
Artificial intelligence already underpins more than 1,600 FDA-authorized medical devices, most of them for reading medical images, and it is now also designing experimental drugs. Insilico Medicine's rentosertib, whose biological target and molecule were both generated by AI, entered a 320-patient Phase III trial in China on July 7, 2026, while global regulators are still drafting rules to govern the technology's risks.