photomopOpen the studio

AI and on-device processing

Diffusion model

Also called latent diffusion, stable diffusion or denoising diffusion. Here is what it means, when it changes what you export, and what people get wrong.

AI and on-device processingRuns on your deviceUpdated 10 August 2026

The short answer

A diffusion model generates images by learning to undo noise. During training it watches clean pictures get progressively scrambled; at generation time it runs that process backwards, starting from pure noise and removing a little at each step until a coherent image is left.

Updated

The short version

Diffusion model at a glance

Quick facts about Diffusion model: core idea, latent diffusion, cost per image, guidance, typical uses in editing, weak spots
Quick factDetail
Core ideaLearn to reverse a gradual noising process
Latent diffusionDenoises in a compressed space, then decodes
Cost per imageOne network pass per sampling step
GuidanceTrades prompt adherence against variety
Typical uses in editingGenerative fill, object removal, restyling
Weak spotsSmall text, fine repeating texture, hands

Slide the table sideways to see every column.

How does denoising turn into image generation?

Training has a forward half that needs no learning at all. Take a real photo, add a small amount of random noise, add a little more, and keep going until nothing but noise remains. Every intermediate state is a training example, and the network is asked one question: given this noisy image and how far along it is, what noise was added?

Generation reverses the walk. Start from a fresh field of noise, ask the network what noise it sees, subtract a portion of it, and repeat. Each pass nudges the image towards something the model considers realistic. After enough steps the noise is gone and what remains is a picture that was never photographed.

What does latent diffusion change?

Running that loop directly on pixels is punishing, because a megapixel image means millions of values passing through the network dozens of times. Latent diffusion adds an autoencoder in front: a compressor that maps the image into a much smaller latent representation, and a decoder that maps it back.

The denoising loop then runs entirely in that compressed space, on a fraction of the values, and only the final latent is decoded into pixels. The saving is large enough that image generation moved from cluster hardware to ordinary consumer GPUs. The cost is that the autoencoder is lossy, which is why very fine texture and small text often come back slightly softened or mangled.

What do sampling steps and guidance actually control?

Steps are how many times you run the denoiser. Few steps are fast but leave structure unresolved; more steps refine detail with diminishing returns, and past a point they mostly cost time. The sampler algorithm decides how large a stride each step takes, which is why some samplers reach a usable image in far fewer steps than others.

Guidance controls how hard the model is pushed towards your prompt rather than towards whatever it finds plausible. Low guidance drifts off-brief. High guidance follows the words closely but tends to produce oversaturated colour, harsh contrast and rigid, repetitive composition. The useful setting is a middle range, and it interacts with the number of steps.

Why is it so much heavier than a segmentation model?

A segmentation or matting network runs once. You feed it an image, you get a mask, and the work is one forward pass. A diffusion model runs its network once per sampling step, so the same weights are evaluated dozens of times for a single output image.

The weights are also far larger, and generation needs room for the latents, the text encoder and the decoder at the same time. That combination, many passes over a large model, is why generative editing usually needs a capable GPU or a server, while background removal and upscaling can comfortably run in a browser tab on a laptop.

What people get wrong about diffusion model

Each one is a real failure mode, not a style preference.

  1. Pushing guidance high to force prompt accuracy, then wondering why every result looks oversaturated and stiff.

  2. Raising step count to fix a bad composition, when steps refine detail rather than change what the model decided to draw.

  3. Expecting a diffusion edit to preserve the exact pixels of a product, since the decoder rewrites everything it passes through.

  4. Assuming the same prompt and seed reproduce identically across different samplers or runtimes, which they generally do not.

Questions people ask

Diffusion model, answered

The follow-up questions people search for once they have the definition.

Why do diffusion models struggle with text in images?

Letters are a rigid symbolic system, and the model learns texture and shape statistics rather than spelling. Latent compression makes it worse by discarding exactly the fine high-contrast detail letterforms depend on. Results have improved, but small text remains one of the least reliable things to generate.

Is a diffusion model the same thing as a GAN?

No. A GAN generates an image in one pass, trained against a discriminator that tries to spot fakes. A diffusion model generates iteratively by denoising. Diffusion is generally more stable to train and more diverse in output, at the cost of being slower to sample.

Can a diffusion model run in a browser?

Technically yes, and small ones do, but the download size and memory demands are much higher than for a segmentation or upscaling model. Most in-browser image tools reserve local execution for single-pass networks and treat full generative editing as a heavier, separate case.

What is a seed, and does it guarantee the same image?

The seed initialises the starting noise, so the same seed with the same model, prompt, sampler, step count and guidance reproduces the same image. Change any of those, including the runtime or hardware precision, and you can get a visibly different result.

Now do it to a photo

Photomop is a photo studio that runs on your own device. Resize, crop, compress, convert, batch edit, remove a background and change one all work in the browser tab you are reading this in, at full resolution and with no watermark. The on-device page shows you how to check that the photo stays put.