fashn-logo
FASHNAI

API Parameters Guide

Model Image

image URL | base64

model_image is the primary image of the person on whom the virtual try-on will be performed. You can provide the image as a publicly accessible URL or a base64 string.

Model image guide
💡 Mode Tips

Use mode: performance to quickly test and find model and garment combinations that work well. Once you're satisfied, switch to mode: quality to produce a final high-quality result ready for publishing.

*Tips for selecting the best model image and avoiding common issues.

Garment Image

image URL | base64

garment_image is the reference image of the clothing item to be tried on the model_image. The image can be provided as a URL or a base64 string. FASHN supports a variety of garment photo types, as shown below:

Model image guide

*Infographic displaying supported garment image types ranked from best (left) to worst (right).

💡 Image Handling Tips

Read Image Preprocessing Best Practices to ensure your requests reach our servers fast and without issues

Common Image Issues

For Image URLs:

  • Ensure the URL is publicly accessible without permission restrictions.
  • Confirm the Content-Type header matches the image format (e.g., image/jpeg, image/png).

For Base64 Images:

  • Prefix the string with data:image/<format>;base64, where <format> is the image type (e.g., jpeg, png).

Category

'auto' | 'tops' | 'bottoms' | 'one-pieces'

Specifies the type of garment in the garment_image to apply to the model_image. If the garment image includes multiple items (e.g., a t-shirt and jeans), use this parameter to select which item to apply.

  • auto (recommended): Automatically determines the garment category. For flat-lay or ghost mannequin images, garment type detection is automatic. For on-model images, full-body shots default to swapping the entire outfit, and focused shots (upper or lower body) select the most likely garment type (tops or bottoms).
  • tops: Specifies garments for the upper body (e.g., shirts, blouses).
  • bottoms: Specifies garments for the lower body (e.g., pants, skirts).
  • one-pieces: Specifies single-piece garments or full-body garments (e.g., dresses, jumpsuits).
Model image guide

*Examples of try-on results for categories 'tops', 'bottoms', and 'one-pieces'.

Mode

performance | balanced | quality

The mode parameter determines the trade-off between processing speed and output quality:

  • performance: Fastest, with reduced image quality.
  • balanced: A middle ground, offering a good balance between speed and quality.
  • quality: Slowest, delivering the highest-quality results.
Model image guide

*Side-by-side comparison of results for 'performance', 'balanced', and 'quality' modes.

💡 Mode Tips

Use mode: performance to quickly test and find model and garment combinations that work well. Once you're satisfied, switch to mode: quality to produce a final high-quality result ready for publishing.

Garment Photo Type

auto | model | flat-lay

Defines the garment photo type for optimal performance:

  • model: Photos of garments on a model.
  • flat-lay: Flat-lay or ghost mannequin images.
  • auto: Automatically detects the photo type.

flat-lay is required for precise handling of flat-lay images where elements like back neck labels or size tags should be excluded.

Garment Photo Type Guide

*Comparison of 'flat-lay' and 'model' configurations with flat-lay input.

Number of Samples

integer

The num_samples parameter specifies how many images to generate in a single run. By increasing num_samples, you can explore multiple variations simultaneously, improving the likelihood of achieving a desirable result.

Because num_samples introduces diversity within a batch, its practical effect is similar to running multiple trials with different seeds. However, when used with the same seed value, the results remain reproducible for a given num_samples count.

💡 FASHN Tip

Great try-on results might just be a seed change away! Conversely, a poor outcome doesn’t necessarily mean the input combination won’t work—sometimes a simple seed change can make all the difference. Use num_samples: 2-4 along with mode: performance to quickly test multiple seeds and assess how sensitive your inputs are to seed variation.

On this page