TechJune 23, 20268 min read

Diffusion models: how deep learning “dresses” images

More and more often, we hear about generating, editing, and sometimes even forging images with artificial intelligence. But how do these models really work?

The deep learning models used to create or process images are very different from classic natural language models (such as GPT 5.5, Gemini 3.1, or Opus 4.8). Many well-known tools, such as Stable Diffusion and Midjourney, are based on diffusion models: models that learn to generate images through a progressive process of destruction and reconstruction. The most recent models, such as Gemini Flash Image (a.k.a. Nano Banana) or GPT-image, have taken partly different paths: how they work is rather complex, but understanding the underlying mechanism helps you see their potential and limits more clearly.

Diffusion models are generative models: they are used to create data, in our case images, similar to the data they were trained on. Their logic is almost counterintuitive: during training, the models first learn to progressively degrade images by adding noise, until they are reduced to pure “static,” like the noise on old cathode-ray TVs with no signal. Then they learn to take the reverse path: starting from a noisy representation and removing the noise step by step, until a coherent image is reconstructed.

Once images have been broken down, destroyed, and then recreated, the central question becomes: what value does this process actually produce?

Conditioning: where virtual try-on comes from

The answer comes down to one word: conditioning.

The interesting part comes during reconstruction: this is where the model can be “conditioned” and steered toward a specific result. This paves the way for applications like virtual try-on, which deliver in just a few steps results that, until recently, required advanced graphic design skills.

The most advanced models accept multiple images as input (the photo of the model on whom to “apply” the garment and the photo of the garment itself) along with text that guides the reconstruction. A prompt-guided model therefore does not merely reconstruct an image: it can generate a result with well-defined characteristics, adapting the garment to the model in a believable way. In the case of virtual try-on, this means respecting elements such as fit, silhouette, proportions, the drape of the fabric, and the way the garment interacts with the body.

On a more technical level, the names change depending on the type of model. In classic diffusion models (such as Stable Diffusion), the destruction step is called forward, while the reconstruction is called denoising, precisely because it “removes” the noise step by step.

Adding text and images serves to guide the denoising process through conditioning. In this phase, the conditioning content, such as the text prompt or the reference images, is encoded into numerical representations, that is, embeddings, which the model can interpret. The model starts from a noisy representation and, step after step, updates it to obtain an increasingly well-defined image. At each step, the embeddings of the prompt and of the visual references steer the reconstruction, telling the model which elements to keep, which characteristics to respect, and which result to converge toward. This is how text and reference images progressively shape the image as it emerges from the noise.

Not all models are diffusion models

At this point a clarification is in order: not all image generators are diffusion models. There are also autoregressive models, which work “token by token” like LLMs (they generate the image one piece at a time, the way ChatGPT generates text word by word), and hybrid models, which combine autoregressive generation and diffusion.

Google’s Gemini Flash Image models, commonly known as Gemini Flash Image, are believed to belong to this latter family, as is OpenAI’s image generation (GPT-image). The fundamental point, however, doesn’t change: even in autoregressive generation, the input content, images and text, conditions the output, because it is turned into tokens. The how changes (guided denoising vs. guided token generation), but the principle of conditioning stays the same.

The test: dedicated model vs. conditionable model

To understand what changes in practice, we compared two approaches on the same task, dressing a model in a given garment:

  1. a dedicated, “closed” model: Google Vertex AI Virtual Try-On (virtual-try-on-001), which accepts images only (a photo of the person + a photo of the product), with no text prompt;

  2. general-purpose, conditionable models: Gemini 3.1 Flash Image and GPT-image-2, which accept images and text, and which we can therefore steer to improve, for example, the fit of a garment.

That is precisely the axis of the comparison: on one side a specialized model (image-only input, fixed task, no way to guide it with words); on the other a general-purpose, steerable model (images + text), more flexible but less specialized and in need of careful instruction.

In the first case we can see that Vertex’s try-on model correctly replaced our model’s jeans with the cargo pants from the still-life image, keeping the pocket details, the brand labels, and the washed-out effect. From the image, however, it’s clear that the fit was not respected: the cargo pants took on the same shape as the original jeans instead of their own.

In the second case, by contrast, Nano Banana 2 (the Gemini 3.1 Flash Image model), being able to be guided by text as well, adapted the cargo pants with a realistic fit, respecting the garment’s own silhouette, including the natural way the hem of the pants falls over the shoe, with minimal variations in the model’s lighting.

In conclusion, virtual try-on has gone from being a manual, costly operation to a technology within reach of anyone who knows how to guide it.

Whether you choose a dedicated model like Vertex AI or a general-purpose, conditionable one like Nano Banana, the principle stays the same: behind a convincing result there is always good conditioning, made of images and text that steer the model step by step.

For those working in fashion and e-commerce, this means showing a garment on a model in a few seconds, without a dedicated shoot, a concrete advantage, as long as you also know its limits.

Enrico Antonini, Deep learning engineer @Bantoa

AIDeep LearningTaggingTech
Keep reading

More articles dal panorama fashion-tech

All articles

Want to become the next case study?

Discover how Bantoa solutions can grow your brand.

Request a demo