Virtual Try-On

Use these APIs to Upload Human/Garment Photos, and perform Virtual Try-on.

virtual-tryon-image
Virtual Try-on

Upload Image

post

API to send Human/Garment Image for Pre-Processing.

Authorizations
Body
imagestring · binaryOptional

all image file types are supported

typestringOptional

model or garment

Example: model
genderstringOptional

male or female

Example: male
accessstringOptional

private or public

Example: private
Responses
200
Successful response
application/json
post
POST /api/v1/experiment_image/ HTTP/1.1
Host: prod.server.tryonlabs.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 68

{
  "image": "binary",
  "type": "model",
  "gender": "male",
  "access": "private"
}
200

Successful response

{
  "id": "xxxxxxxxxx",
  "image_url": "api/v1/ei/6307170380/d?token=xxxxx-xxxxx-xxxxx-xxxxx",
  "created_on": "2024-08-29T00:12:07.228977Z",
  "image": "/media/uploaded_images/xxxx.png",
  "type": "model",
  "gender": "male",
  "model_type": "null",
  "garment_type": "null",
  "garment_brand": "Unknown",
  "file_url": "null",
  "access": "private",
  "shopify_product_id": "null",
  "shopify_product_handle": "null",
  "images_dir": "6307170380",
  "token": "xxxxx-xxxxx-xxxxx-xxxxx",
  "token_expiry": "2024-08-30T00:12:07.238254Z",
  "preprocessing": "pending",
  "user": "7476083494"
}

Get Status of Uploaded Image

get

API to get status of pre-processing of Human/Garment

Authorizations
Path parameters
idstringRequired

ID of experiment image

Responses
200
Successful response
application/json
get
GET /api/v1/experiment_image/{id}/ HTTP/1.1
Host: prod.server.tryonlabs.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "xxxxxxxxxx",
  "image_url": "api/v1/ei/6307170380/d?token=xxxxx-xxxxx-xxxxx-xxxxx",
  "created_on": "2024-08-29T00:12:07.228977Z",
  "image": "/media/uploaded_images/xxxx.png",
  "type": "model",
  "gender": "male",
  "model_type": "null",
  "garment_type": "null",
  "garment_brand": "Unknown",
  "file_url": "null",
  "access": "private",
  "shopify_product_id": "null",
  "shopify_product_handle": "null",
  "images_dir": "6307170380",
  "token": "xxxxx-xxxxx-xxxxx-xxxxx",
  "token_expiry": "2024-08-30T00:12:07.238254Z",
  "preprocessing": "completed",
  "user": "7476083494"
}

Start Virtual Try-on

post

API to start the Try-on using previously uploaded Human and Garment Image IDs

Authorizations
Body
person_idstringOptional

Id you get after uploading human image for pre-processing

Example: xxxxxxxxxx
garment_idstringOptional

Id you get after uploading garment image for pre-processing

Example: xxxxxxxxxx
actionstringOptional

name of model to be used, for current use case use virtual_try_on

Example: virtual_try_on
Responses
200
Successful response
post
POST /api/v1/experiment/ HTTP/1.1
Host: prod.server.tryonlabs.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 78

{
  "person_id": "xxxxxxxxxx",
  "garment_id": "xxxxxxxxxx",
  "action": "virtual_try_on"
}

No content

Get Status of Virtual Try-on

get

API to get status of Try-on(Takes About 30 Seconds)

Authorizations
Path parameters
idstringRequired

ID of experiment image

Responses
200
Successful response
get
GET /api/v1/experiment/{id}/ HTTP/1.1
Host: prod.server.tryonlabs.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Download Image

get

API to Download Images

Authorizations
Path parameters
idstringRequired

ID of experiment image

tokenstringRequired

Image Token from Human/Garment/Try-on Image

Responses
200
Successful response
application/json
get
GET /api/v1/ei/{id}/d HTTP/1.1
Host: prod.server.tryonlabs.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "binary"
}

Last updated