Try-On JavaScript Quickstart
Check out our SDK
We suggest using our TypeScript SDK rather than the manual method described below. Find more details in the TypeScript SDK documentation.
Below is a minimal JavaScript snippet to demonstrate how to:
- POST to the
/runendpoint with your input data. - Poll the
/status/<ID>endpoint until the prediction is completed. - Retrieve the final results from the
"output"field.
For detailed documentation (including advanced parameters and usage), please refer to:
- Virtual Try-On v1.6 Documentation
- tryon-nextjs-app (interactive Next.js example)
- Integrate FASHN SDK into your Next.js application
Minimal JavaScript Example
This snippet demonstrates a basic request using model and garment image URLs. You can also adapt the code to send local images in Base64 format.