Appearance
Create Avatar
POST
/api/v1/generation-avatar
Create a generation request for an avatar. The generation will create new images of the avatar, based on your prompt and camera angle.
avatar_id
- ID of an existing avatar to generate images for.
generation_setting
(optional) - Controls the background of the generated image:
-
color_hex
- Background color hex code (e.g.,#ffffff
,#00000000
for transparent). Omitgeneration_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
, orauto
(recommended).
Authorizations
HTTPBearer
TypeHTTP (bearer)
Request Body
JSON
{
"num_images": 0,
"prompt": ""
}
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
}
POST
/api/v1/generation-avatar
Samples
cURL
curl -X POST \
'https://api.uwear.ai/api/v1/generation-avatar' \
-H "Content-Type: application/json"
JavaScript
fetch('https://api.uwear.ai/api/v1/generation-avatar', {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-avatar';
$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-avatar'
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers)
print(response.json())