AI

What Is a Diffusion Model? How AI Makes Images

A diffusion model makes images by removing noise step by step. How it works, how it is trained, the main types, an example, and diffusion vs LLMs.

By OmniAI Editorial · Nov 20, 2026 · 11 min read

A diffusion model is a type of generative AI that creates an image by starting from pure random noise and removing that noise a little at a time until a clear picture appears. It learns how to do this by watching millions of real images being slowly destroyed with noise, and practising how to undo each step. Most of today's AI image tools, many AI video tools and a growing number of audio tools are built on diffusion models.

This guide explains how a diffusion model works in plain language, how it is trained, the main types of diffusion models, a step-by-step diffusion model example, how a diffusion model differs from an LLM and from a GAN, and what words like checkpoint, sampler and CFG mean when you run one yourself.

What Is a Diffusion Model, in Simple Terms?

Think of a photo slowly dissolving into TV static. Add a little noise, then a little more, and after enough steps nothing of the photo is left. That forward process is easy: anyone can add noise.

A diffusion model learns the reverse. Given a noisy image, it predicts which part of it is noise. Subtract that prediction, and the image becomes slightly cleaner. Repeat this many times, starting from pure static, and the model "uncovers" a brand new image that never existed but looks like the images it learned from.

When you type a prompt such as "a red bicycle on a beach at sunset", the text steers every one of those denoising steps, so the image that emerges matches your words.

How Does a Diffusion Model Work?

A diffusion model has two processes, and only the second one needs a neural network.

The forward process: adding noise

During training, the system takes a real image and adds a small amount of random (Gaussian) noise over and over, following a fixed schedule. After hundreds or a thousand steps, the image is indistinguishable from random noise. This part involves no learning at all; it is simple maths.

The reverse process: removing noise

The neural network learns to go backwards. At each step it receives a noisy image plus a number saying how noisy it is, and it predicts the noise that was added. A sampler uses that prediction to produce a slightly cleaner image, then asks the network again. After enough steps, you get a finished picture.

The network inside is usually a U-Net (an image network that shrinks and then re-expands the picture) or, in newer models, a transformer. If you want the background on the transformer side, see our guide to the transformer model.

How text guides the image

To follow a prompt, the model needs to understand text. A separate text encoder turns your prompt into numbers (embeddings), and the denoising network looks at them at every step through attention. A trick called classifier-free guidance (CFG) makes the result follow the prompt more strongly: the model makes one prediction with your prompt and one without, and pushes the image further in the direction of the prompted version. The CFG scale setting in image tools controls how hard it pushes.

Five grey square frames in a row joined by ink arrows, the first full of scattered ink dots, the next frames with fewer dots and a clearer light hill shape, and the last showing a clean light hill with an orange sun.
The reverse process: each step removes a little predicted noise until a clear image is left.

How Diffusion Models Are Trained

Training is surprisingly simple to describe:

  1. Take a real image (and its caption, for text-to-image models).
  2. Pick a random noise level.
  3. Add that much random noise to the image.
  4. Ask the network to predict the noise that was added, given the noisy image, the noise level and the caption.
  5. Compare the prediction with the real noise and nudge the network's weights to reduce the error.
  6. Repeat billions of times over a huge dataset.

Because the network sees every noise level, from barely noisy to pure static, it learns to clean up images at every stage. Nothing in training ever asks it to draw a whole image in one go; it only learns small cleaning steps. Generation then chains those small steps together.

The idea was introduced in research in 2015 and became practical with the 2020 paper "Denoising Diffusion Probabilistic Models" (DDPM) by Ho, Jain and Abbeel. A 2021 OpenAI paper by Dhariwal and Nichol showed diffusion models could beat GANs on image quality, and the field moved quickly after that.

A Diffusion Model Example, Step by Step

Here is a diffusion model example of what happens when you ask an image tool for "a lighthouse on a cliff, watercolour":

  1. Encode the prompt. The text encoder turns the prompt into embeddings.
  2. Start from noise. The tool creates a grid of random numbers. In a latent diffusion model this grid is a small compressed "latent" (for example 128 × 128 values with a few channels) rather than full-size pixels. The random seed decides exactly which noise you start from, which is why the same seed and settings give the same image.
  3. Denoise, step by step. For, say, 30 steps, the network predicts the noise, the sampler removes part of it, and the latent gets cleaner. Early steps decide the overall layout (cliff on the left, sea below). Late steps add detail (brush texture, light on the waves).
  4. Decode. A decoder called the VAE turns the finished latent back into a full-resolution image.
  5. Show the result. Change the seed and you get a different lighthouse; change the prompt and every step is steered differently.

This is why image tools expose settings such as steps, sampler, seed and CFG scale. They all control parts of this loop.

Types of Diffusion Models

There are several types of diffusion models. These are the ones you will meet most often:

  • Pixel-space diffusion: the original approach, denoising full-resolution pixels. Accurate but slow and expensive at large sizes.
  • Latent diffusion: first compresses the image into a much smaller latent space with an autoencoder, then runs diffusion there. Introduced by Rombach and colleagues in the paper behind Stable Diffusion, it made high-quality generation possible on consumer GPUs and is now the standard design.
  • Diffusion transformers (DiT): replace the U-Net with a transformer that treats the latent as a grid of patches. This design scales well with more data and compute, and is used by many recent image and video models.
  • Flow matching and rectified flow: a closely related family that learns a straighter path from noise to image, which can need fewer steps. Stable Diffusion 3 and several newer open models use rectified flow; they are usually still called diffusion models.
  • Distilled, few-step models: "turbo" or "lightning" versions trained to produce good images in 1 to 8 steps instead of 30 or more, by learning from a slower teacher model. This teacher-student training is called distillation.
  • Video and audio diffusion: the same idea extended over time (video frames) or sound (spectrograms or audio latents).
  • Text diffusion models: experimental language models that generate text by refining a whole block of tokens at once, covered in the LLM section below.

Diffusion Model vs Checkpoint, LoRA, VAE and Sampler

If you use ComfyUI, Automatic1111 or similar tools, you will meet a lot of jargon. The most common question is diffusion model vs checkpoint. A checkpoint is simply a saved file of a diffusion model's trained weights at a point in training. When people say "download the SDXL checkpoint", they mean the model itself, stored as a file (usually .safetensors). Many checkpoints also bundle the text encoder and VAE.

TermWhat it isWhat changing it does
Diffusion modelThe trained denoising network (the "brain")Changes style, quality and what it can draw
CheckpointA saved file of a model's weightsSwapping checkpoints swaps the whole model
LoRAA small add-on file that adjusts a modelAdds a style, character or concept on top
VAEEncoder/decoder between pixels and latentsAffects colours and fine detail at the end
Text encoderTurns your prompt into embeddingsAffects how well prompts are understood
Sampler / schedulerThe method for taking each denoising stepChanges speed and look; some need fewer steps
StepsHow many denoising steps to runMore steps: slower, often more detail, up to a point
CFG scaleStrength of prompt guidanceToo low ignores the prompt; too high looks harsh
SeedThe starting noiseSame seed and settings reproduce the same image

This table is the quickest way to understand a node graph in ComfyUI: almost every node maps to one row.

Diffusion Model vs LLM

Diffusion model vs LLM is a common question because both are generative AI, but they generate in very different ways:

  • How they generate: a typical LLM is autoregressive. It writes one token at a time, left to right, and each token depends on the ones before. A diffusion model starts with the whole output as noise and refines all of it at once over many steps.
  • What they are good at: diffusion dominates images, video and much of audio, where every part of the output must fit together. Autoregressive transformers dominate text and code.
  • Architecture: they are not opposites. Many modern diffusion models use a transformer inside, and many LLMs can call a diffusion model to make an image.

There is also a newer crossover: diffusion language models. Instead of writing word by word, they start with a block of masked or noisy tokens and fill it in over several passes. Google has shown an experimental Gemini Diffusion model, Inception sells Mercury diffusion LLMs, and open research models such as LLaDA exist. Their main selling point is speed, because many tokens are produced in parallel. They are still a small part of the market compared with standard LLMs.

Diffusion Models vs GANs

Before diffusion, the best image generators were GANs (generative adversarial networks): a generator and a discriminator trained against each other. Compared with GANs:

  • Quality and variety: diffusion models usually give more varied, higher-quality images and are much easier to train at scale.
  • Speed: a GAN makes an image in one pass; a diffusion model needs many passes. Distilled few-step diffusion models have closed much of that gap.
  • Control: diffusion models are easier to guide with text, edit parts of an image (inpainting) and extend with add-ons such as LoRAs and ControlNets.
Split by a dotted divider: on the left, a row of small square blocks above an ink arrow pointing right, the first four grey, the fifth orange and the rest light; on the right, a grey square full of ink dots with a curved ink arrow leaving its top and pointing back into it.
An LLM writes one token after another; a diffusion model refines the whole output at once.

What Diffusion Models Are Used For

  • Image generation and editing: text-to-image, inpainting, outpainting and style transfer. Our comparison of AI image generators covers the main tools.
  • Video generation: most AI video tools use diffusion across frames.
  • Audio and music: sound effects, music and some voice systems.
  • Science and medicine: designing protein structures and molecules, improving low-quality medical scans, and weather forecasting research.
  • Robotics: "diffusion policies" generate smooth sequences of robot actions.

Limits and Risks of Diffusion Models

  • Compute cost: training needs very large GPU clusters; running one needs a decent GPU, especially for video.
  • Text and hands: older models struggled with readable text and fingers. Newer ones are much better, but errors still happen.
  • Training data questions: many models were trained on scraped web images, which raises copyright and consent questions that courts are still working through.
  • Misuse: realistic fake images make deepfakes easier. Labels, provenance data and careful checking of sources help.
  • Bias: models repeat patterns in their training data, such as stereotypes in who appears for a given job.

FAQ

What is a diffusion model in AI?

A diffusion model is a generative AI model that creates images, video or audio by starting from random noise and removing it step by step. It learns this by being trained to predict the noise added to real data at many different noise levels.

Is Stable Diffusion a diffusion model?

Yes. Stable Diffusion is a family of latent diffusion models: it runs the denoising process in a compressed latent space and uses a VAE to turn the result into a full image. Newer versions use a transformer and rectified flow instead of the original U-Net design.

Is a diffusion model a transformer?

Not necessarily. "Diffusion" describes the generation method (denoising from noise), while "transformer" is a network architecture. Early diffusion models used a U-Net; many newer ones, called diffusion transformers, use a transformer as the denoising network.

Why do diffusion models need many steps?

Each step only removes a small amount of predicted noise, because the model was trained to make small corrections. Fewer, larger jumps would make errors. Better samplers, flow matching and distilled few-step models reduce the number of steps a lot.

Can diffusion models generate text?

Yes, experimentally. Diffusion language models generate a block of text in parallel and refine it over several passes, which can be much faster than word-by-word LLMs. Most text AI today still uses autoregressive LLMs.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog