Image models do their work on a compressed version of the picture, and the space that compressed version lives in is called latent space. Working on every pixel would be too slow and too expensive. So the model squeezes the picture into a much smaller set of numbers, does its work there and turns the result back into pixels at the end.
This explains how the editing tools work and why the small print on a product nearly always comes out wrong. We will follow a pickle brand that wants a generated picture of its mango pickle jar on a kitchen shelf.
How a picture is squeezed and rebuilt
The squeezing is done by an encoder and the rebuilding by a decoder. Together they are called a VAE, and they decide a surprising amount of the final image quality. The compressed version of a picture is called a latent. All the denoising from the last lesson happens on the latent, and only at the very end does the decoder turn it back into a picture you can see.
Latent space is organised. Points close together decode into pictures that look related, and directions in the space turn out to mean things, so moving along one can change a face's expression or shift the time of day. Nobody designed these directions. They came out of the training. Moving smoothly between two points is called interpolation, and it makes the morphs you have seen where one picture melts into another.
Use the editing tools as moves in the space
Most features that feel like magic are ways of choosing where to start in this space and which way to go.
| Tool | What it does in latent space |
|---|---|
| Image-to-image | Starts near your input picture instead of at random noise |
| Inpainting | Freezes most of the latent and lets the model redo one patch |
| Style adapter | Nudges the whole process towards one region of the space |
So when the pickle brand likes a shelf scene but wants a different cloth under the jar, inpainting is the move, because everything outside the patch stays as it was. When they want a fresh scene that keeps the approved one's layout, image-to-image starts close to the approved picture instead of from nothing.
Why the small print comes back wrong
The encoder throws detail away, and fine detail goes first, such as small type, a thin serif, a barcode or the weave of a fabric. That is why the ingredient list on the jar keeps coming back almost right. The letters were lost on the way into latent space, so the decoder has nothing exact to rebuild.
Anything that must be exact should be added afterwards at full resolution. For the jar that means the wordmark, the ingredient panel, the barcode and any legal line. Generate the scene with the jar in it and treat whatever the model wrote on the label as a placeholder. Its layout is useful, but its letters are not.
Put the real label back by hand
Take the label from the print artwork, the PDF or the vector file, never from a screenshot or the generated picture, because only the source file has the real type at full size. In Photoshop, place it as a Smart Object, which keeps the artwork sharp however often you reshape it. Bend it with Warp for a round jar, or Perspective Warp for the flat face of a box.
Then lay the jar's own shading over the label on a layer set to Multiply, so the label darkens where the glass turns away from the light. Flat artwork on a lit object is the first thing that looks pasted on. Match the grain and softness of the scene, check every word at 100% against the artwork, and scan the barcode with your phone.
The next lesson explains tokens and embeddings, and how words become directions.