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 Neural Networks Learn: The Math Behind ChatGPT and Gemini
Neural networks learn by making a prediction, measuring how wrong it was with a loss function, and then adjusting internal values called weights backward through the network — a process called backpropagation paired with an optimisation method called gradient descent. The same mechanics, scaled to billions of parameters, underlie how systems such as ChatGPT and Gemini are first trained and then adapted to specific tasks through fine-tuning.

Artificial intelligenceArticle
How AI Generates Art and Music, and Why "True Creativity" Remains Disputed
AI image tools like Midjourney and Stable Diffusion build pictures by learning to reverse a noise process, while music tools like Suno and Udio compress audio into tokens and predict them step by step, guided by a text prompt. Whether either process counts as genuine creativity is unresolved: researchers are split between calling it pattern-based "remixing" and crediting it with measurable creative performance.
Artificial intelligenceArticle
Why Moonshot Deliberately Weakened Its New Kimi AI Model's Hacking Skills
Chinese AI lab Moonshot says it removed cyber-related training data from its new Kimi K3.1 Pro model so the open-weight system would not push the "frontier" of offensive hacking capability. The move, announced Saturday, October 24, 2026, comes as governments and security researchers warn that increasingly capable AI could make sophisticated cyberattacks cheaper and easier to carry out.
Artificial intelligenceArticle
How AI Text Detectors Work, Explained Through a Prize-Winning Novel Dispute
AI text detectors do not prove who wrote something; they estimate a probability by measuring statistical patterns such as word predictability and sentence-length variation. A detector called Pangram 4.1 recently attributed 99% of a €20,000 prize-winning Spanish-language novel to artificial intelligence, prompting its publisher to suspend promotional events while it investigates.