Skip to main content

Virtual Try On - Upper Body

Generate images by combining clothing and model images using the Fashion Image Generation API. Customize the image generation process with various parameters.


import requests
import json

url = "https://api.imagepipeline.io/fashion_upper/v1"
headers = {
"API-Key": "your-api-key",
"Content-Type": "application/json"
}
data = {
"cloth_image": "https://example.com/clothing.jpg",
"model_image": "https://example.com/model.jpg",
"num_inference_steps": 30,
"guidance_scale": 15,
"samples": 4,
"server_id": "your-server-id",
"webhook": "https://example.com/webhook",
"direct_link": true,
"batch_id": "batch123",
"file_prefix": "fashion_",
"queued_image_urls": true
}
response = requests.post(url, headers=headers, json=data)
print(response.json())

Available JSON Parameters for Control

ParameterTypeNotes
cloth_imagestringrequired. Public URL for the clothing image.
model_imagestringrequired. Public URL for the model image.
num_inference_stepsintegerrequired. Number of inference steps.
guidance_scalenumberrequired. Max: 20. The guidance scale for the image generation.
samplesintegerrequired. Max: 4. Number of image samples to generate.
server_idstringOptional. Provide a server ID for load-balancing or to use an enterprise subscription.
webhookstringURL to send the generated image to.
direct_linkbooleanFetches the friendly URL in PNG format.
batch_idstringAdds a batch ID for the image generation request.
file_prefixstringAdds a prefix to the generated files.
queued_image_urlsbooleanReturns the links of the images prematurely. The link will have the image once the task is run successfully.

Status

Your response will include a status.

  • If the status = SUCCESS, you will also have download_urls that will contain the links to your generated image based on the number of samples you have entered. The maximum number of samples that can be generated is 4.
  • If the status = PENDING, you will receive an id. You can use the status endpoint to fetch your image using the id.
  • If the status = FAILURE, you will receive only an error message.

Endpoint: [GET]

  • https://api.imagepipeline.io/fashion_upper/v1/status/{{id}}

Pass the API-Key as the authorization in the header.