DEV Community

Cover image for When the product is 5% of the frame, the prompt problem inverts
xiaodong Zhang
xiaodong Zhang

Posted on

When the product is 5% of the frame, the prompt problem inverts

I wrote previously about a skill that dresses a model in a flat-lay garment. Same library has a sibling for accessories — shoes, bags, watches, glasses, hats, scarves, necklaces, earrings, belts, gloves.

I assumed it would be the same problem with a different noun. It is not, and the reason is worth a post.


The frame-share problem

A sweater occupies most of the image. The model cannot really lose track of what the subject is.

A pair of sunglasses occupies maybe 5% of the frame. At that scale the model has enormous latitude, and it uses it — tilting them, oversizing them, floating them somewhere near the face, or smearing them into the hair.

So the documentation puts one sentence in bold above everything else:

The selection region is the decisive parameter.

Not the model. Not the resolution. Not the quality tier. Where the thing goes.


Anatomy strings, not bounding boxes

The interesting design choice is that you do not draw a box. You describe the anatomical attachment in prose, and each category has a canonical phrasing:

Category The sentence
Glasses seated on the nose bridge and hooked over both ears
Watch on the left wrist, dial facing the camera
Necklace clasp at the nape, pendant resting on the collarbone
Earring on the visible earlobe, at correct scale
Hat brim angle following the head tilt
Scarf wrapped twice, fringe over the chest
Shoes soles contacting the ground with correct perspective and grounded shadows
Bag held in hand or on the shoulder, strap compressing the fabric

These read like stage directions because that is effectively what they are. soles contacting the ground with correct perspective and grounded shadows encodes three separate constraints — contact, perspective, and shadow — in one clause, and dropping any of them produces the classic floating-shoe artifact.

Full call:

dlazy gpt-image-2 \
  --prompt "On-model accessory product photography. Image 1 is a pair of
   tortoise-brown rectangular acetate sunglasses with gradient brown lens
   tint and metal hinges. Image 2 is the model and scene reference.
   Place the sunglasses from image 1 on the face of the person in image 2,
   seated on the nose bridge and hooked over both ears, with natural
   perspective matching the head angle, correct real-world scale relative
   to the face width, realistic lens reflections and a soft contact shadow.
   Preserve 100% fidelity of the frame shape, tortoise acetate grain, hinge
   and temple design, and the exact lens tint.
   Change nothing else — face, hair, coat, background, color grading and
   crop must remain identical to image 2.
   Photorealistic, no text, no watermark." \
  --images product-sunglasses.jpg model-reference.jpg \
  --size 1024x1536 --quality high --batch 3 \
  --save out/SKU001.jpg
Enter fullscreen mode Exit fullscreen mode

The lock clause is not optional

Note that second-to-last sentence. It is doing critical work.

Change nothing else — face, hair, clothing, background, color grading
and crop must remain identical to image 2.
Enter fullscreen mode Exit fullscreen mode

Because the product is tiny, the model has spare capacity and will happily spend it repainting the face. You end up with correctly-placed sunglasses on a person who is subtly not the same person.

The anatomy string and the lock clause are a pair. Ship them together every time. And when the lock fails, the fix is to stop being general — replace "everything else" with an itemised list of the specific things that must not move.


Reference selection is stricter than for garments

Three hard requirements, all more demanding than the garment equivalent:

1. The wearing area must be visible and unobstructed. Glasses need a clear face. A watch needs a bare wrist — a shirt cuff kills it. Shoes need feet not hidden under a long skirt.

2. The model must not already be wearing the same category. Otherwise you get two pairs of sunglasses. If you cannot avoid it, add an explicit replace the existing sunglasses clause.

3. Light direction should roughly match the product shot. Metal and lenses generate reflections, and reflections lit from the wrong side read as fake immediately.

I generated my reference images deliberately against these rules — a face shot specified as no glasses, hair tucked behind the ears, and a wrist shot specified as sleeve rolled up above the wrist, no watch on either wrist. Worth doing if you are producing references rather than sourcing them.


Multi-view for complex geometry

Simple items (glasses, necklaces) work from one view. Complex ones do not.

  • Shoe → side profile plus sole
  • Bag → front plus interior

The skill takes up to 5 reference images, so [product-view-1, product-view-2, reference] maps to image 1 / image 2 / image 3. Feeding a second angle is the documented fix for garbled bag interiors — the model cannot infer the inside of a bag it has only seen closed.


Symptom mapping

Same design as its sibling skill: enumerated failure modes, each with a specific append.

Symptom Cause Append
Glasses crooked or floating Missing anatomy string The section-3 phrase for that category
Shoes not grounded No contact clause Ground contact + grounded shadow
Wrong size No scale anchor A width ratio against a body part
Two pairs of glasses Reference already wore some replace the existing …
Face changed Lock clause too vague Itemise the untouchable elements
Metal looks like plastic Quality tier --quality mediumhigh
Bag interior garbled Insufficient geometry Supply additional views

The --quality one is worth internalising: use high for metal, lenses and leather; medium is fine for fabric accessories. At 60 vs 33 credits that distinction is worth making deliberately rather than defaulting.


Parameters

  • --images — product first, reference last. Order maps positionally to image N, silently.
  • --size1024x1536 for half/full-body wear shots, 1024x1024 for wrist or earring close-ups.
  • --batch 2–4 — placement varies run to run more than it does for garments, precisely because the target region is small.
  • --dry-run — always, before a loop.

QC dimensions specific to this

Five things to check, and they are not the same five you check on a garment:

  1. Placement — is it anatomically right
  2. Proportion — is the scale plausible
  3. Reflection plausibility — does the light direction match
  4. Duplicates — did a second pair appear
  5. Was the face altered

That last one is the sneaky failure. The accessory can be perfect while the model's face has quietly shifted. If you are producing a series against one locked model, this breaks the series and it is easy to miss when you are looking at the product.


Takeaway

The generalisable lesson: as the edit region shrinks relative to the frame, prompt precision has to increase, not decrease.

Intuition says a small edit is an easy edit. In practice a small target gives the model more freedom to be wrong, and more spare capacity to wander into regions you never asked it to touch. Two sentences fix both — one saying exactly where the thing attaches, one saying nothing else may move.


MIT licensed, 19 skills, works with Claude Code / Codex / Cursor:

npx skills add https://github.com/dlazyai/ecommerce-skills --all
Enter fullscreen mode Exit fullscreen mode

Repo: github.com/dlazyai/ecommerce-skills

Top comments (0)