fashn-logo
FASHNAI

Try-On Max

Try-On Max is our recommended virtual try-on endpoint, built for AI fashion photoshoots and publishable e-commerce content. It places products onto model images with enhanced fidelity, producing images suitable for PDPs, catalogs, and marketing assets.

This endpoint supports clothing, shoes, hats, jewelry, bags, and other wearable fashion items.

Model Specifications
  • Model Name: tryon-max
  • Lifecycle: experimental
  • Processing Time: 20s–120s (see below)
  • Output Formats: PNG, JPEG
  • Delivery Methods: URL or Base64 encoding
  • Credits: 2-5 per output image depending on resolution and generation_mode

Request

Generate try-on images by submitting your product and model images to the universal /v1/run endpoint:

POSThttps://api.fashn.ai/v1/run

Request Examples

curl -X POST https://api.fashn.ai/v1/run \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -d '{
           "model_name": "tryon-max",
           "inputs": {
             "product_image": "https://example.com/garment.jpg",
             "model_image": "https://example.com/person.jpg"
           }
         }'

Response

Returns a prediction ID for status polling:

{
  "id": "123a87r9-4129-4bb3-be18-9c9fb5bd7fc1-u1",
  "error": null
}

Request Parameters

Required Parameters

product_image
Required
image URL | base64

URL or base64 encoded image of the product (garment, accessory, etc.) to place on the model.

Base64 Format

Base64 images must include the proper prefix (e.g., data:image/jpg;base64,<YOUR_BASE64>)

model_image
Required
image URL | base64

URL or base64 encoded image of the person to wear the product. The try-on process preserves the model's identity, pose, and styling while seamlessly integrating the product.

Base64 Format

Base64 images must include the proper prefix (e.g., data:image/jpg;base64,<YOUR_BASE64>)

Optional Parameters

promptstring

Optional instructions to customize the try-on result. Use this to adjust how the product is worn or make minor styling changes.

Examples: "remove scarf", "tuck in shirt", "roll up sleeves", "open jacket".

Default: Empty string (uses intelligent defaults based on the images)

resolution'1k' | '2k' | '4k'

Output resolution tier. '1k' produces ~1 megapixel output, '2k' ~4 megapixels, and '4k' ~16 megapixels. Exact output dimensions depend on this tier and the image aspect ratio.

Default: '1k'

generation_mode'balanced' | 'quality'

Sets the generation quality level. 'quality' produces the most detailed and realistic output but takes longer to process and costs more credits. 'balanced' offers a middle ground between speed and quality. If omitted, FASHN selects generation_mode automatically. For tryon-max, omitted generation_mode is currently billed as 'quality'.

seedinteger

Sets random operations to a fixed state. Use the same seed to reproduce results with the same inputs, or a different seed to force different results.

Default: 42 Range: 0 to 2^32 - 1

num_imagesinteger

Number of images to generate in a single request. Must be between 1 and 4. Additional images consume more compute (and credits) and can increase processing time.

Default: 1

output_format'png' | 'jpeg'

Specifies the output image format.

  • png: Lossless quality, best for further editing or when maximum fidelity is needed.
  • jpeg: Smaller file size with slight compression, suitable for direct web use.

Default: png

return_base64boolean

When set to true, the API will return the generated image as a base64-encoded string instead of a CDN URL. The base64 string will be prefixed according to the output_format (e.g., data:image/png;base64,... or data:image/jpeg;base64,...).

This option offers enhanced privacy as user-generated outputs are not stored on our servers when return_base64 is enabled.

Default: false

Credit Cost

generation_mode \ resolution1k2k4k
balanced234
quality345

Additional pricing rules:

  • num_images multiplies the total cost by the number of outputs requested.
  • If generation_mode is omitted, automatic pricing applies.

Processing Time

Processing time depends on both resolution and generation_mode. The fastest configuration (balanced + 1k) typically completes in under 30 seconds, while the most intensive (quality + 4k) can take up to 120 seconds. Actual latency may vary with current server load.

Response Polling

After submitting your request, poll the status endpoint using the returned prediction ID. See API Fundamentals for complete polling details.

Successful Response

When your try-on generation completes successfully, the status endpoint will return:

{
  "id": "123a87r9-4129-4bb3-be18-9c9fb5bd7fc1-u1",
  "status": "completed",
  "output": [
    "https://cdn.fashn.ai/123a87r9-4129-4bb3-be18-9c9fb5bd7fc1-u1/output_0.png"
  ],
  "error": null
}

The output array contains URLs to your generated try-on images with the product seamlessly placed on the model.

Runtime Errors

Runtime errors for Try-On Max use the shared set in Error Handling.

On this page