Skip to content

Create Generation

POST
/api/v1/generation

Create a generation request. The generation will create new images of a clothing item worn by a virtual model or an avatar, based on your prompt and camera angle.

Clothing Specification (Required):
You must specify the clothing item using ONE of the following:

clothing_item_id - ID of an existing clothing item you've previously uploaded.

clothing_item_data - Upload a new clothing item directly with these fields:

  • clothing_item_name - Provide a user-friendly name for your clothing item.
  • description - Provide description details to improve AI accuracy (otherwise auto-generated).
  • description_back - Provide back description details to improve AI accuracy (otherwise auto-generated).
  • external_clothing_item_url - An image of the front of your clothing item.
  • external_clothing_item_back_url (optional) - An image of the back of your clothing item.
  • use_image_enhancement - Default true (costs 1 credit). Set false only if you have clean flat lay photos and descriptions.

Avatar Specification (Optional):

avatar_id (optional) - ID of a saved avatar to use for the generation. If not provided or set to null, a virtual model will be used instead.

Generation Settings:

generation_setting (optional) - Controls the background of the generated image:

  • color_hex - Background color hex code (e.g., #ffffff, #00000000 for transparent). Omit generation_setting entirely to use prompt-based background. Add "studio photography" to prompt for solid colors.

num_images - How many images to generate (1-5).

prompt - Describe the image you would like to generate, emphasizing the human model description.

enhance_user_prompt - Default true. Set false only if you have a specific well-crafted prompt.

camera - Specify camera angle: full body shot, midshot, lower body shot, lower body back shot, back shot, or auto (recommended).

Authorizations

HTTPBearer
TypeHTTP (bearer)

Request Body

JSON
{
"clothing_item_id": 0,
"clothing_item_data": {
"clothing_item_name": "",
"description": "",
"description_back": "",
"external_clothing_item_url": "",
"external_clothing_item_back_url": "",
"use_image_enhancement": true
},
"generation_setting": {
"color_hex": ""
},
"num_images": 0,
"prompt": "",
"camera": "",
"enhance_user_prompt": true,
"avatar_id": 0
}

Responses

Successful Response
application/json
JSON
{
"generation_id": 0,
"clothing_item_id": 0,
"num_images": 0,
"payload": "string",
"status": "string",
"feature_name": "string",
"created_at": "string",
"updated_at": "string",
"avatar_id": 0
}

Samples

cURL
curl -X POST \
'https://api.uwear.ai/api/v1/generation' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://api.uwear.ai/api/v1/generation', {method:'POST',headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://api.uwear.ai/api/v1/generation';
$method = 'POST';
$headers = [
    'Content-Type' => 'application/json',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://api.uwear.ai/api/v1/generation'

headers = {
    'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers)
print(response.json())
Powered by VitePress OpenAPI