DEV Community

Alex
Alex

Posted on Originally published at axgv.dev on

Telling an image model which picture is which

When you send an image model several reference pictures, the prompt has to say which is which. The reliable way is an index at the top of the prompt:

Image 1 is the foundation style.

Image 2 is the air fleet.

Image 3 is the sketch to put the style and the fleet on.

…then the actual request

The index works every time, but writing one for every request is a chore, especially on an iPad with no keyboard. We tested two ways to skip it, on Codex's image tool and in Muse, our node canvas at SplayFlo:

  • File names. Save each picture under a meaningful name and use that name in the prompt.
  • Labels. Draw each picture's name onto the picture itself, in a frame.

TL;DR

  • File names. In the tested workflows, uploads were renamed before reaching the model, so the names we gave the files did not identify the references.
  • Labels. With each reference framed under its name, the model followed the label over the order 15 times out of 16 across four models in Muse.
  • Names matter. When a label's name described a different picture, the model sometimes followed the meaning instead. Use names that match the picture, or abstract ones.
  • No visible leakage. None of 16 renders drew a label, its letters or a frame into the scene.

The file name never arrives

File names were the cheapest to test. We sent one reference picture and asked the model to draw a sign with that picture's file name on it.

Item Value
File sent zebra-umbrella-42.png
Sign, render 1 16b5080a4fdd77172f12d9e1ca146cf5.png
Sign, render 2 another 32-character code

The codes differ, and neither is the file's checksum: somewhere between our request and the model, every reference is uploaded again under a random name. Whatever we call the file, the model never sees it.

No labels: order decides

Without names, the model has two things to go on: what each picture shows, and the order the pictures arrive in. When the pictures look different, their content is enough:

  • A Rift City scene built from four references came out right with names in the prompt instead of a numbered legend, in either order. In another Rift City scene, we used Blender to repair inconsistent views for an AI video.
  • Two vehicle sheets, passenger craft and freight haulers, were matched correctly even with their file names swapped.

Craft from the passenger fleet fly above the arch; craft from the freight fleet are parked in a row on the plaza.

A plaza under a white arch with a row of parked freight haulers, a crane and container carriers in front, and passenger craft flying above

Passenger craft, flying sheet sent as freight fleet.png

Freight haulers, parked sheet sent as passenger fleet.png

All 8 renders parked the haulers and flew the passenger craft, whatever the files were called and whichever sheet went first. This one had the names swapped.

Pictures of the same kind are the hard case, because only a name can tell them apart. We used two character sheets, Max and Pav, with the same prompt for every render, and varied the file names and which picture was sent first. A separate judge, who didn't know the setup, checked who sat on the bench.

Max sits on the bench on the left holding a green kite. Pav stands on the right, waving.

Renders with Max on the bench, as the prompt asks.

File names Max's picture sent first Pav's picture sent first
Right names 2 of 2 0 of 2
Swapped names 2 of 2 0 of 4
No names 2 of 2 0 of 2
Numbered legend 2 of 2 3 of 3

Without a numbered legend, the kid on the bench was always the one whose picture went first, whatever the file names. Only the legend got it right in both orders.

A name drawn on the picture

The second idea puts the name where no upload step can strip it: in the pixels. Same kids, same prompt, plus:

  • Frame: each picture in a dark frame, its name on a bar above it.
  • Prompt line: one extra sentence saying the labels and frames aren't part of the picture, the kind an app can add on its own.

Renders that seated the kid labeled MAX.

Labels Max's picture sent first Pav's picture sent first
Right 2 of 2 3 of 3
Swapped 2 of 2 2 of 2

All 9 renders followed the label, in both orders. With the labels swapped, that put Pav, the kid in the yellow shirt, on the bench: the model read the label and ignored the order.

That was one model, Codex's. To check others, we sent the same framed pictures through Muse to four image models. Muse sends references as a plain list of pictures, so the frames are the only names the model sees. Two renders per model per setup, judged blind.

In the no-label column, the count shows renders that followed the order. In the two labeled columns, it shows renders that followed the label.

Model No labels, Pav first Labels swapped, Max first Labels right, Pav first
GPT Image 2.5 Flare (via fal) 2 of 2 2 of 2 1 of 2
Nano Banana 2.1 (via fal) 2 of 2 2 of 2 2 of 2
MAI-Image-2.6 Flash (via OpenRouter) 2 of 2 2 of 2 2 of 2
Meta Muse Image (via OpenRouter) 2 of 2 2 of 2 2 of 2

Without labels, all four models put the first-sent kid on the bench, 8 of 8. Where the label and the order pointed at different kids, the label won 15 of 16. The one miss: Flare once seated Pav although Max's picture was correctly labeled MAX.

Names that mean something

Back on Codex's image tool, we tried three more kinds of reference from our Rift City cards: two characters, two craft and two places, all with made-up names. Each prompt asks for one of the pair by name, in two setups:

  • Labels right, the requested picture sent second.
  • Labels swapped, the requested picture sent first.

Renders that drew the picture labeled with the requested name.

Kind Labels right Labels swapped
Characters: Pim, Taro 2 of 2 2 of 2
Craft: the Kestrel, the Orbis 2 of 2 2 of 2
Places: Vell Square, Ossa Gardens 4 of 4 0 of 4
Places, abstract names: Kesh, Tolvar 2 of 2 2 of 2

With correct labels, the label won 10 of 10, against the order every time. With swapped labels, characters and craft still followed the label. Places didn't: every render drew the arch plaza.

The reason is in the names. "Vell Square" sounds like the plaza and "Ossa Gardens" like the green deck. The prompt asked for Vell Square, the swapped label put that name on the gardens, and the model drew the plaza anyway, correcting our wrong label. With meaningless names, Kesh and Tolvar, the model followed the label in both setups.

Asked for Vell Square meaning won

Reference 1: plaza, labeled OSSA GARDENS

A plaza under a tall white arch with market stalls, in a dark frame labeled OSSA GARDENS

Reference 2: garden, labeled VELL SQUARE

A green deck of raised walkways and waterfalls among towers, in a dark frame labeled VELL SQUARE

Result: plaza

The plaza under the white arch with market stalls and a fountain

Asked for Kesh label won

Reference 1: plaza, labeled TOLVAR

The plaza under the tall white arch with market stalls, in a dark frame labeled TOLVAR

Reference 2: garden, labeled KESH

The green deck of raised walkways and waterfalls, in a dark frame labeled KESH

Result: garden

The green deck with looping raised walkways, waterfalls and a round pool among towers

The same two places, labels swapped both times. Under descriptive names the model drew the plaza, labeled OSSA GARDENS, because Vell Square sounds like a plaza. Under abstract names it drew the picture labeled KESH.

The model doesn't copy reference pictures blindly. It works out what each one shows, a plaza with a market, a garden deck with waterfalls, and matches that against the meaning of the names in the prompt. The vehicle sheets showed the same effect.

When a name's meaning and a drawn label disagree, the meaning can win. That's less a bug than a property of some image models, and it says how to name references: with something that doesn't contradict the picture. Muse never sends swapped labels; they were only a test.

Labels don't leak

Labels are text inside the picture, and image models copy what they're given, so we checked whether labels end up in renders. On Codex's image tool:

  • Sent: Lex's character card and the Foundation Style card, both framed. Then the same with Max.
  • Prompt: Lex walking down a busy shopping street, a scene that invites signs.
  • Varied: which card went first, and whether the prompt ended with "No text, lettering or signs."
  • Renders: two per setup, 16 in all.

16 renders, judged blind with every sign, corner and edge enlarged.

Check Result
Drew a label's letters (LEX, MAX, FOUNDATION, STYLE) 0 of 16
Drew a frame or a title bar 0 of 16
Drew the right kid 16 of 16

The only readable text in any render is a café chalkboard, in one whose prompt didn't ban text. The test can't show whether the renders followed the style card: the character cards are drawn in the same style, so the renders would look the same either way.

What Muse does with it

Muse adds no new node. A generator's Inputs list gets one switch, Labeled. When it's on, every reference goes out in a dark frame with its name on a bar above it; when it's off, all of them go plain.

A Muse canvas: two media nodes, Passenger fleet and Freight fleet, wired into a Generate Image node, Spacecraft Assembly, whose Inputs list has the Labeled switch on and marks both inputs References · Labeled
Two fleet sheets wired into Generate Image, with Labeled on. Each input now reads "References · Labeled".

It's all or none because labels only work when every reference has one: with a mix, the model matches the unlabeled pictures by order again. The label is the name of the node the picture comes from, and a max.png dropped onto the canvas is already named "max", so there's usually nothing to type.

Every framed test prompt opened with a sentence naming the references and ended with "No text, lettering or signs." Neither was tested without, so Muse writes the opening sentence itself:

Two reference images are supplied: Lex and Foundation Style. Each reference image shows its name on a label above it; the labels and dark frames are not part of the picture or its style.

The frame needed three fixes along the way. The first was label size. OpenAI says gpt-image-1 shrinks a reference to 512 px on its shortest side. At that size the tested MAX label was 36 px tall, but the first frame rule shrank labels on tall pictures and long names. The new rule keeps every label between 25 and 74 px: the bar grows with the picture, and long names wrap to two lines instead of shrinking.

Label Height at 512 px
Tested MAX 36 px
First rule, 9:16 26 px
First rule, long name 12 px
New rule 25–74 px

Label letter height once a reference is shrunk to 512 px on its shortest side.

The other two:

  • Edge. A thin gray line now separates the picture from the frame. Without it, a card with dark edges ran straight into the dark frame, and a model couldn't see where the picture stopped.
  • Size limit. The framed picture stays within each model's size limit for a reference. Qwen Image accepts at most 2048 × 2048, so the picture is scaled down until the whole frame fits.

Bottom line: the frame works. When it isn't enough, turn Labeled off: the index, with a description of each picture in the prompt, is still the bulletproof fallback.

This article was prepared with AI assistance.

Top comments (0)