Virtual Try-On Recipe

Use this recipe to apply a garment onto a person photo. The default endpoint is single-call (fal-ai/fashn/tryon/v1.5), but the recipe wraps it with optional pre-processing (background cleanup) and post-processing (upscale) for production-quality output.

Inputs to collect

Single-call flow

URL_PERSON=$(genmedia upload ./person.jpg --json | jq -r '.url')
URL_GARMENT=$(genmedia upload ./dress.jpg --json | jq -r '.url')

genmedia run fal-ai/fashn/tryon/v1.5 \
 --model_image "$URL_PERSON" \
 --garment_image "$URL_GARMENT" \
 --garment_type "dress" \
 --download "./outputs/tryon/{request_id}_{index}.{ext}" \
 --json

Inspect schema first, field names may evolve:

genmedia schema fal-ai/fashn/tryon/v1.5 --json

Full pipeline (pre-clean + tryon + upscale)

For e-commerce-grade output, chain three steps:

Step 1: garment background removal

If the garment image has a busy background, the tryon model may pick up artifacts. Remove the background first:

URL_GARMENT_RAW=$(genmedia upload ./garment.jpg --json | jq -r '.url')

# Discover or use a known background-removal endpoint
RES_BG=$(genmedia run <bg-removal-endpoint> --image_url "$URL_GARMENT_RAW" --json)
URL_GARMENT_CLEAN=$(echo "$RES_BG" | jq -r '.image.url')

For background-removal endpoint discovery:

genmedia models "background remove" --json
genmedia models --endpoint_id fal-ai/bria/background/remove --json

Step 2: try-on

URL_PERSON=$(genmedia upload ./person.jpg --json | jq -r '.url')

RES_TRYON=$(genmedia run fal-ai/fashn/tryon/v1.5 \
 --model_image "$URL_PERSON" \
 --garment_image "$URL_GARMENT_CLEAN" \
 --garment_type "top" \
 --quality "quality" \
 --json)
URL_TRYON=$(echo "$RES_TRYON" | jq -r '.image.url')

Step 3: optional upscale for final delivery

genmedia run <upscale-endpoint> \
 --image_url "$URL_TRYON" \
 --download "./outputs/tryon/{request_id}_{index}.{ext}" \
 --json

For upscale endpoint selection, see fal-models-catalog/image-to-image.md.

Garment type guidance

Type Use for
top T-shirts, blouses, jackets, sweaters
bottom Pants, jeans, skirts, shorts
full-body Suits, jumpsuits, overalls
dress Dresses, gowns, robes

If unsure, leave it out and let auto-detect handle it. Specify when results misplace the garment.

Quality bar

Before returning:

Tips

Common parameters

Always inspect:

genmedia schema fal-ai/fashn/tryon/v1.5 --json

Frequently exposed:

Discovery for alternative tryon models

genmedia models "virtual tryon" --json
genmedia models "garment transfer" --json
genmedia docs "virtual tryon" --json