fashn-logo
FASHNAI

Image Preprocessing Best Practices

To ensure optimal performance and consistent outputs when using the FASHN API, it’s important to preprocess your images. By following these guidelines, you can prevent issues like large payloads or inconsistent results.


  1. Resize

    • Resize images to fit within the maximum resolution supported by the endpoint you're using:
      • 1K endpoints (e.g., Try-On v1.6): max 2000px on the longest edge
      • 4K endpoints (e.g., Product to Model with resolution: '4k'): max 6000px on the longest edge
    • Maintain aspect ratio to avoid distortion.
    • Use a quality-preserving downsampling technique (e.g., LANCZOS or INTER_AREA) for best results.
  2. Convert to JPEG

    • Use a quality setting of around 95 to balance file size and image clarity.
  3. Upload to a CDN

    • Instead of embedding large base64 strings in your request, upload the processed image to a CDN, and provide the image URL in your API request

Following these best practices helps ensure that your requests reach our servers without issues, leading to faster response times and more consistent results with the FASHN Web App.

On this page