AI virtual try-on that shows how a size really fits

In this first version, shoppers upload one photo, get their measurements, and see a top rendered tight, true to size or loose before they buy.

Illustration: a shopper uploads one photo and their height, the app reads their measurements with a confidence score for each, then shows the same top in sizes S, M and L as tight, true to size and loose.

Project snapshot

Client
Try-On project markVirtual try-on platform for online stores
Industry
eCommerce: virtual try-on (SaaS API)
Duration
About 1 month
Team
2 people1 AI/ML engineer, 1 UX/UI designer
Budget
Under $30k
Delivered
  • Body measurement from a photo
  • Fit-analysis engine
  • AI prompt writing
  • Try-on image generation on our own GPU service
  • Demo web app
AI
Working first versionRunning end to end
Key stack
  • Python
  • MediaPipe
  • Gemini 2.5 Flash Image
  • FLUX.1 Kontext
  • Modal

This system shows online shoppers how a specific size of a top will fit their body, not just how it looks. From one photo it estimates their measurements, compares them with the garment's size in centimetres, and renders a photorealistic try-on with tension lines or drape. Techuz built the full pipeline in about a month.

The client: a try-on platform for online stores

The client offers virtual try-on to online fashion stores through an API, so the stores' shoppers can try clothes before they buy. It doesn't sell clothes itself.

We built the try-on for women's tops, from T-shirts and blouses to polos and bodysuits. Shoppers browse at home on a phone or laptop, so they can't try anything on in person.

The challenge: a size S and an XL looked the same

Shoppers on those stores couldn't tell how a garment would really fit, so they guessed the size and sent things back.

Standard virtual try-on doesn't fix that. It pastes the garment onto a photo, so a size S and an XL look identical.

Here's what the try-on had to get right:

  • Measurements without a tape measure or special hardware
  • Showing the difference between sizes, not just the garment
  • Photorealistic images from the shopper's own photo
  • Not being locked into one paid image API
  • Letting shoppers check and correct their numbers

Key decisions and why we made them

Three choices shaped this try-on. We measure from one photo, turn fit into visual rules, and run a self-hosted image model next to a paid API.

From photo to try-on

  1. One photo: Plus height
  2. Body measurements
  3. Compared with the garment: Its size in cm
  4. Fit rules: Tight = tension lines, loose = folds and drape
  5. Image prompt
  6. Try-on image: Gemini or our self-hosted FLUX model
  1. Measurements from one photo

    The easy options were asking shoppers to type in their measurements, or a 3D scan. We estimate them from a single photo with MediaPipe Pose, a body-tracking model, calibrated by the shopper's height.

  2. Fit turned into visual rules

    We compare the garment's size with the shopper's body in centimetres. Each difference becomes a visual rule: tight means tension lines, loose means folds and drape.

    Those rules shape the image prompt, instead of a generic “put this shirt on”.

  3. A self-hosted image model next to a paid API

    We self-host the FLUX.1 Kontext image model on Modal's serverless GPUs, alongside Google's Gemini 2.5 Flash Image API.

Two smaller calls

  • A fallback when the API says no. The image API sometimes refused prompts describing a very tight fit. The self-hosted model and a rule-based prompt take over when that happens.

  • Measuring without a GPU. MediaPipe runs on an ordinary processor, so only image generation needs a GPU.

What we built

Shoppers use a simple web app. They upload a photo, check their measurements, pick a garment and size, and get their try-on image.

A front photo with the detected pose drawn on it, beside the measurements taken from it

Get measurements without a tape measure

Automatic body measurement from one photo

One top compared in sizes S, M and L against the shopper's chest and shoulders: tight, true to size and loose

See how a specific size will fit

Fit-aware rendering: tight, true to size or loose

Editable measurements, each with its confidence score

Check and correct their numbers

Editable measurements with confidence scores

Garment cards: one try-on ready to download, one being created

Try any garment in one click and keep the result

Catalogue try-on with download

Also delivered

See themselves wearing a garment before buyingPhotorealistic AI try-on

How the project ran

We built the full pipeline, from photo to finished image. We estimated garment sizes from product photos to start.

2people

1
AI/ML engineer
1
UX/UI designer

The results

The system runs end to end, from one photo to a finished try-on image. Shoppers can see the difference between a size S and an XL on their own body, instead of guessing. The client says more than 50 stores have tried it through its API, and that shoppers stayed on those sites longer. The next step is real size charts for the catalogue, which make every fit more accurate.

Tech stack

  1. Body measurement

    Runs on a CPU, so measuring needs no GPU

    • MediaPipe Pose Landmarker
    • OpenCV
    • NumPy
  2. Prompt writing

    • Llama 3.3 70Bon Groq
  3. Image generation

    Two models avoid depending on one vendor

    • Gemini 2.5 Flash Image
    • FLUX.1 Kontextdev
  4. GPU service

    Billed per GPU-second, and switches off when idle

    • Modalserverless L40S GPUs
    • FastAPI
  5. Demo app

Questions about this project

  • Yes, if it knows both the body and the garment. Here, the shopper's measurements are compared with the garment's size in centimetres, and the difference decides whether the image shows tension or drape.

  • Yes, a body can be measured roughly from one photo. Here, MediaPipe estimates measurements from one photo calibrated by height, shows a confidence score for each, and lets the shopper correct them.

  • Using both a self-hosted image model and an API avoids lock-in. Here, a self-hosted FLUX model on serverless GPUs runs alongside the Gemini API and takes over when the API refuses a prompt.

Get a Ballpark Estimate for Your Project

Tell us what you're building. We reply within 24 hours and send a ballpark estimate within 48.

Tell us about your project

A few lines are enough. We reply within 24 hours.

By sending this form I confirm that I have read and accept the Privacy Policy