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.

You can specify the subject of the generation using one of the following:

avatar_id (optional) - ID of an existing avatar to generate images for. Use this OR clothing_item_id OR clothing_item_data.

clothing_item_id (optional) - ID of an existing clothing item to generate images for. Use this OR clothing_item_data OR avatar_id.

clothing_item_data (optional) - Alternatively, upload a new clothing item directly using these fields (Use this OR clothing_item_id OR avatar_id):

  • 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.

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