References
AI Fashion Model V4

AI Fashion Model V4

💡
Before using the API, make sure you have read our Authorization documentation to get set up with Vmake's API authentication.

AI Fashion Model API can specify parts of an image to remain unchanged using a Mask, and then replace existing models or mannequins with other models.

Create asynchronous task

🌐
POST https://open.vmake.ai/api/v4/image/ai-fashion-model/clothing-tasks

Create an asynchronous clothing task to generate model images for clothes try-on.

Pricing

Each task costs 1 credit and we provide different pricing plans to meet your needs. You can check the pricing details on the Pricing page (opens in a new tab).

Request body


image    string    Required
💡
The supported image formats are JPEG and PNG.
Input an image URL or Base64 encoded image data, pay attention to the size of the image must be consistent with the size of the Mask.

mask    string    Optional    Defaults to null
💡
You can leave this field as null to automatically generate a mask based on the input image and clothes segmentation.
Input PNG mask URL or Base64 encoded image data.

batchSize    number    Optional    Min 1    Max 4    Defaults to 4
The count of output results in the Task object.

modelId    string    Required
Indicates which model to use. Check out available models.

sceneType    enum    Required
Indicates the scene type to use.
Allowed values:
  • original: Indicates that the generated image will use the original background from the input image.
  • preset: Indicates that the generated image will use a scene based on the selected 'sceneId'
  • color: Indicates that the generated image will use a solid color background corresponding to the specified color value
  • none: Indicates that the generated image will have a transparent background.

sceneId    string    Optional    Defaults to null
💡
This field only required when the scene type is preset.
The preset scene ID indicates the scene to use, if the scene type is preset, this field must be set.  Check out available scenes.

sceneColor    string    Optional    Defaults to null
💡
This field only required when the scene type is color.
The background color to use, if the scene type is color, this field must be set (e.g., #000000).

modelSize    enum    Optional    Defaults to similar
Indicates the size of the model. By default, the size of the model is similar to the size of the input image.
Allowed values:
  • similar: Indicates that the model size is similar to the size of the input image.
  • s: Indicates that the model size is small.
  • m: Indicates that the model size is medium.
  • l: Indicates that the model size is large.

modelExpression    enum    Optional    Defaults to similar
Indicates the expression of the model, by default, the expression of the model is similar to the expression of the input image.
Allowed values:
  • similar: Indicates that the expression of the model is similar to the expression of the input image.
  • smile: Indicates that the model is smiling.
  • laugh: Indicates that the model is laughing.
  • cool: Indicates that the model is cool.

callbackUrl    string    Optional    Defaults to null
The callback URL to receive the task update notification. The notification will be sent to the callback URL every time the task status changes:
  • pending: The task has been created and is waiting to be processed.
  • running: The task is in progress and a notification will be sent each time there is an update.
  • success: The task completed successfully.
  • error: The task failed with error(s).

Response body

The standard response body will be returned.


taskId    string    Required
The asynchronous task ID to query the status of the task.

{
  "code": 0,
  "message": "Success",
  "data": {
    "taskId": "0f1c2d3e-4f5g-6h7i-8j9k-a1b2c3d4e5f6"
  }
}

Query task status

🌐
GET https://open.vmake.ai/api/v4/image/ai-fashion-model/clothing-tasks/{taskId}

Query the status of the asynchronous task. You can poll the status of the task by calling this API periodically if callbackUrl field of the Create asynchronous task API is not set.

Different status will return different response body as follows:

The task has been created and is waiting to be processed.

{
  "code": 0,
  "message": "Success",
  "data": {
    "taskId": "0f1c2d3e-4f5g-6h7i-8j9k-a1b2c3d4e5f6",
    "status": "pending",
    "message": "Pending",
    "progress": 0
  }
}

Request parameters


taskId    string    Required
The asynchronous task ID returned by the Create asynchronous task API.

Response body

The standard response body will be returned. The data field is a Task object.

Task object

Represents the task returned by the Query task status API.


taskId    string    Required
The asynchronous task ID.

status    string    Required
The status indicates the current status of the task.
Allowed values:
  • pending: The task has been created and is waiting to be processed.
  • running: Indicates that the task is processing.
  • success: Indicates that the task has been successfully completed.
  • error: Indicates that the task failed with error(s).

message    string    Required
The message indicates the current status message of the task.

progress    number    Required
The progress of the task.

results    array    Required
The results of the task. Each element in the list represents a Result object.

Result object

Represents each element in the results list in the Task object.


width    number    Required
The width of the image.

height    number    Required
The height of the image.

fileSize    number    Required
The size of the image in bytes.

downloadUrl    string    Required
The download URL of the image.

Get preset model list

🌐
GET https://open.vmake.ai/api/v4/image/ai-fashion-model/preset-models

Get a list of pre-trained models. Each element in the list represents a Preset model object.

Response body

The standard response body will be returned.


presets    array    Required
Represents a list containing all preset models. Each element in the list represents a Preset model object.

{
  "code": 0,
  "message": "Success",
  "data": {
    "models": [
      {
        "id": "002",
        "thumbnail": "https://seawaveprod.blob.core.windows.net/bvbiz/vmake/admin/web/ai-fashion-model/bac25529-b993-4e10-bfd6-3db98406703d.jpeg",
        "name": "Clara",
        "gender": "Female",
        "skin": "Fair",
        "age": "Youth"
      },
      {
        "id": "003",
        "thumbnail": "https://seawaveprod.blob.core.windows.net/bvbiz/vmake/admin/web/ai-fashion-model/7b23fe20-6718-43f1-80ae-a80836e3664f.jpeg",
        "name": "Jamila",
        "gender": "Female",
        "skin": "Deep",
        "age": "Youth"
      },
    ]
  }
}

Preset model object

Represents each element in the preset model list returned by the Get preset model list API.


id    string    Required
The preset model ID.

name    string    Required
The preset model name.

thumbnail    string    Required
The preset model thumbnail image URL.

skin    enum    Required
The preset model skin tone.
Allowed values:
  • fair: Light or pale skin tone, often found in European and North American white individuals..
  • medium: Skin tone between light and dark, common in various populations.
  • olive: Skin with a greenish or yellowish undertone, often found in Mediterranean, Middle Eastern, and some Asian populations.
  • deep: Darker skin shades found in populations from Africa, the African diaspora, South Asia, and other regions.
  • tanned: Indicates that the skin tone is tanned.

age    enum    Required
The preset model age range.
Allowed values:
  • children: Indicates that the preset model is a child.
  • teen: Indicates that the preset model is a teenager.
  • youth: Indicates that the preset model is a youth.
  • middle-aged: Indicates that the preset model is middle-aged.
  • senior: Indicates that the preset model is a senior.

Get preset scene list

🌐
GET https://open.vmake.ai/api/v4/image/ai-fashion-model/preset-scenes

Get a list of pre-trained scenes. Each element in the list represents a Preset scene object.

Response body

The standard response body will be returned.


presets    array    Required
Represents a list containing all preset scenes.

{
  "code": 0,
  "message": "Success",
  "data": {
    "scenes": [
      {
        "id": "002",
        "thumbnail": "https://seawaveprod.blob.core.windows.net/bvbiz/vmake/admin/web/ai-fashion-model/4d3bf91c-a90e-42a1-9d90-2785517a0a8a.jpeg"
      },
      {
        "id": "003",
        "thumbnail": "https://seawaveprod.blob.core.windows.net/bvbiz/vmake/admin/web/ai-fashion-model/7c62b5a5-220d-438b-a88f-1773fd1632b1.jpeg"
      }
    ]
  }
}

Preset scene object

Represents each element in the preset scene list returned by the Get preset scene list API.


id    string    Required
The preset scene ID.

thumbnail    string    Required
The preset scene thumbnail image URL.