A 39 cm Box Should Not Be as Large as a Wardrobe

Vibe coding · 5 min read
A 39 cm Box Should Not Be as Large as a Wardrobe

I've been hitting the same wall for a while now. AI is now capable of creating incredibly beautiful atmospheric images — a product in a real room, beautiful lighting, real shadows, you believe it instantly. Except for one thing.
The size is incorrect.
A storage box of 39 cm suddenly appears as large as half a wardrobe. A teddy bear towers over a coffee table. A floor lamp is so small you can barely see it. For a single image, you might give it a nudge. But for an assortment of hundreds of products? Unworkable. You end up spending the whole day saying "no, smaller. No, bigger. No, no."
And so I thought: this needs to change.

The Problem is Deeper Than You Think

My first reflex was, as always: just ask better. "Place this product at a realistic scale relative to a person of 1.80 m." Sounds logical, right?
It doesn't work. Or barely.
I delved into it and there's even a whole benchmark where they test exactly this — does an image model understand how large things should be relative to each other? The answer is painfully clear: almost no model passes this test adequately. They score barely better than guessing. A text instruction is a hint, not a guarantee. The model does something with it, and then still does what it finds aesthetically pleasing.
And that's the crux. As long as you provide size as text, you're still guessing. Period.

The Insight: Scale Should Be Calculated, Not Asked

At some point, it clicked. Why should I let the model determine how large something is when I have the actual dimensions? Height, width, depth — it's all neatly in the product database. Those numbers are concrete. Why would I discard them and then let it guess?
So I turned it around.
You set one reference point in the scene. A person of 1.80 m, for example. That person is a certain number of pixels tall in the image — say 620. Then you immediately know: 620 pixels = 180 cm. In other words: every centimetre in the real world is exactly 3.44 pixels in this image. Simple maths, calculated once.
And from that moment, you know everything. A box 39 cm wide? Then it's simply 39 × 3.44 = 134 pixels wide. No opinion, no guess, no "I think it looks nice." Just a calculation.


Above, you see exactly what I mean. The person on the left is the reference point. The box, the lamp, and the bear next to it are not placed "by feel" — they are calculated from their actual dimensions. Calculate back: that bear comes out at 30 cm, exactly what it is in reality. That's no coincidence. That's architecture.

And What Can the AI Still Do?

Well, quite a lot. Just not the size.
The idea is to programmatically — so just with code, not with a prompt — place the product in the image at the exact calculated size. On the ground line, neatly with a shadow underneath. From that moment, the size is fixed. Concrete.
Then you let the AI loose. But with a very small task: "blend this product nicely into the scene, match the light and shadow, and otherwise stay away from everything." The AI does what it's good at — atmosphere, light, realism — and not what it's bad at: estimating how large a box should be.

The Trust-But-Verify Step

I've been working with AI long enough to know: tell a model "stay away from everything" and there's a real chance it will still sneakily shift or stretch something. I know that behaviour. I don't fall for it anymore.
So there's a check in place. Automatically. After the AI has done its round, the system finds the product again in the final image and measures: is it still in the right place, and does it still have the correct size? If it deviates by more than a few percent, it simply goes again. And if after a few attempts it still isn't right? Then a flag is raised and I take a look myself.
Important detail: this is a measurement, not a second AI that "just assesses whether it looks good." Because such a judgement is precisely that same guesswork. A ruler doesn't lie. An AI that looks at a picture and says "looks good" does.

What is Now in Place (and What Isn't — Being Honest)

A working prototype is running. The calculation step is correct, the composite is correct, and the demo above was literally rolled out — including the back-calculation that proves the sizes are accurate to the centimetre. That part is done and, honestly, quite satisfying to see.
What still needs to be done:

  • Test the harmonisation in practice. Let the light blend in without the product floating. That's where the real work is.

  • Measure the drift percentage. How often does the model still shift? That figure determines whether the simple approach suffices or if I need to resort to heavier measures.

  • Calibrate on scale. The idea is: calibrate 20 scenes correctly once, and reuse them for 800 products. That still needs to prove itself.

So no, I'm not claiming it's "finished." But the foundation is in place, and this is the foundation I believe is correct. Scale is not a matter of asking nicely. Scale is calculation.
And the AI? It can do everything. Except determine the size.
Endoor. Peter.