Text-to-image vs image-to-image: prompts, sketches and reference images

Published

An image generation model can start from nothing but words, or from a picture you give it. The Gen AI lab offers three ways in: text-to-image, image-to-image and reference images. They work differently inside the model, and each suits a different job.

Text-to-image

In text-to-image, the model starts from pure random noise and your prompt, and removes the noise step by step until a picture is left. Everything about the result, the pose, the composition, the colors, comes from the prompt and the seed. It is the quickest way from an idea to artwork, and the least controlled: you describe, the model decides.

Use it when you have an idea but no drawing: an icon, a mascot, a sticker, a set of illustrations in one art style.

Image-to-image

In image-to-image, the model starts from your picture instead of from pure noise. It adds a measured amount of noise to it, burying some of its detail, then denoises as usual, guided by your prompt. What survives the noise, the layout, the pose, the large shapes, carries through into the result; what was buried is filled in fresh. This technique was introduced as SDEdit by Meng and colleagues, who used it to turn rough sketches and paint strokes into finished images.

Strength

Strength sets how much noise is added, from 0 to 1, and so how much of your picture the model may change:

  • Low strength buries only fine detail. The result stays close to your picture: lines are tidied, colors cleaned up.
  • High strength buries almost everything but the broad layout. The model repaints freely, and the result can drift from your drawing.
  • At 0, nothing changes; at 1, the picture is buried completely, and the result is the same as text-to-image.

For a photographed sketch, VTracer first cleans up the photo, lifting the pencil lines off the paper into clean ink, and the model starts from that clean drawing rather than from the photo. Here is one sketch, cleaned up, then generated by Z-Image Turbo with the same prompt and seed at two strengths:

A photo of a pencil sketch of a sitting fox on grey paper, the same sketch cleaned into black ink on white, then two traced results: at strength 0.5 the fox stays close to the sketch as white line art with touches of orange; at 0.75 it becomes a fully colored orange fox, with its face drifting away from the sketch's closed-eye smile.
The photo, the clean ink VTracer lifts from it, then two strengths with one prompt and seed. At 0.5 the drawing leads; at 0.75 the model takes over, adding full color but drifting from the drawing.

The prompt was cute cartoon fox with the details orange and white fur and flat color fills. At 0.5 the result is essentially the sketch, cleaned up, with a hint of color: the prompt's colors cannot get through the drawing. At 0.75, the model has enough freedom to color the fox fully, and the face starts to follow the model's idea of a cartoon fox more than the drawing's. The sweet spot depends on the model and on how finished your sketch is, so it is worth trying a few values.

Each step of a distilled model removes a large share of the noise, so at low strength very few steps are actually run: with four steps and a strength of 0.2, less than one step is left. Models with more steps handle low strengths more gracefully.

Where to start from

For a photographed sketch, the lab can start the round from the clean ink it lifted from the photo, in black and white, from a shaded version with color, or from the original photo. Starting from clean ink keeps paper texture and shadows out of the result; the shaded version gives the model a head start on color. See Pencil to vector.

Reference images

A reference image is used differently. It is not the starting point: the model starts from noise, as in text-to-image, but it can look at the reference while it generates, the way it reads your prompt. So it can borrow a character, a palette or a style from the reference while changing the pose or the composition completely.

That makes a reference image the way to edit a picture with words. Here, FLUX.2 klein was given an earlier fox as its reference, and a prompt asking for a new expression:

On the left, a cartoon fox sitting with its eyes closed in a contented smile. In the middle, the prompt words smiling, mouth open and open eyes. On the right, the same fox, with the same colors, markings, pose and tail, now grinning with its mouth open and one eye winking.
Editing with a reference image. Left, the reference; right, the result, traced. The expression follows the prompt; the character, colors and pose carry over from the reference.

The fox's colors, markings, pose and tail carry over almost exactly; only the expression changes, as the prompt asked. With image-to-image, the same request would have had to fight the closed eyes already in the picture. With a reference, the model draws a new picture that matches it.

Models must be trained for this. In the Gen AI lab, FLUX.2 klein and OpenAI Codex support reference images: click the ⋯ menu on a round and choose Use as reference image to carry its look into the next round (step by step), or use a sketch as the reference. Codex shows three sketched cats redrawn this way. That is the way to edit a character, or to build a consistent set, such as one mascot in several poses or expressions.

Which to use

You have You want Use
An idea Artwork in a given style Text-to-image
A sketch It cleaned up into line art Image-to-image, low strength
A sketch It developed into finished color artwork Image-to-image, medium to high strength
A finished round A change to it, such as a new expression or pose A reference image
A finished round More of the same character or style A reference image

Models differ in which they do best. In the Gen AI lab, Z-Image Turbo is the best for text-to-image, and FLUX.2 klein for image-to-image and reference images.