fashn-logo
FASHNAI

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 Specifications
  • 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:

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": "face-to-model",
           "inputs": {
             "face_image": "http://example.com/path/to/headshot.jpg",
             "output_format": "jpeg"
           }
         }'

Response

Returns a prediction ID for status polling:

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

Request Parameters

face_image
Required
image 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:

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

The images array contains URLs to your upper-body avatars with preserved facial identity, ready for virtual try-on applications.

Runtime Errors

Runtime errors for Face to Model use the shared set in Error Handling.

On this page