Face to Model
The Face to Model endpoint transforms face images into try-on ready upper-body avatars. It converts cropped headshots or selfies into full upper-body representations that can be used in virtual try-on applications when full-body photos are not available, while preserving facial identity.
- Model Name:
face-to-model - Lifecycle: experimental
- Processing Time: 12 seconds
- Output Formats: PNG, JPEG
- Delivery Methods: URL or Base64 encoding
- Credits: 1
Request
Transform face images into professional model shots by submitting the face image to the universal /v1/run endpoint:
Request Parameters
face_imageRequiredimage URL | base64
URL or base64 encoded image of the face to transform into an upper-body avatar. The AI will analyze facial features, hair, and skin tone to create a representation suitable for virtual try-on applications.
promptstring
Optional styling or body shape guidance for the avatar representation. Examples: "athletic build", "curvy figure", "slender frame".
If you don't provide a prompt, the body shape will be inferred from the face image.
aspect_ratiostring
Desired aspect ratio for the output image. Only vertical ratios are supported. Images will always be extended downward to fit the aspect ratio.
Supported ratios: "1:1", "4:5", "3:4", "2:3", "9:16".
Default: 2:3
seedinteger
Sets random operations to a fixed state. Use the same seed to reproduce results with the same inputs, or different seed to force different results.
Default: 42
output_formatstring
Specifies the output image format.
"png"- PNG format, original quality"jpeg"- JPEG format, smaller file size
Default: "jpeg"
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 data:image/png;base64,....
This option offers enhanced privacy as user-generated outputs are not stored on our servers when return_base64 is enabled.
Default: false
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 face-to-model avatar creation completes successfully, the status endpoint will return:
The images array contains URLs to your upper-body avatars with preserved facial identity, ready for virtual try-on applications.
Runtime Errors
If an error occurs during inference (while running the model), the API will return a 200 status code with a prediction status: failed.
Additionally, an error object will be included under the error key in the response.
| Name | Cause | Solution |
|---|---|---|
ImageLoadError | The pipeline was unable to load the face image from the provided inputs. | For Image URLs:
|
ContentModerationError | Prohibited content detected in the provided face image. |
|
ThirdPartyError | A third-party processor failed or refused to handle the request. | FASHN AI relies on external providers for tasks like captioning, moderation, and compute. These services can fail, be unavailable, or experience heavy load. Please retry, and if the issue persists, contact support@fashn.ai. |
PipelineError | An unexpected error occurred during the execution of the pipeline. | Retry the request (you will not be charged for failed attempts). If the issue persists, please reach out to us at support@fashn.ai and include the prediction ID from the failed attempt to help us locate and address the issue promptly. |
The Error Object
Example of an error when polling the /status endpoint:
If you encounter an unrecognized error, please contact us at support@fashn.ai.
Related Guides
- Image Preprocessing Best Practices - Optimize your input images for better results
- Data Retention & Privacy - Understand how FASHN handles your data