Skip to content

Create Edit

POST
/api/v1/generation-edit

Perform text-guided image editing that preserves original image details while making targeted modifications. Specify the input image using ONE of the following:

  • generation_result_id - ID of a previously generated result.
  • image_url - URL of any image.

Editing Capabilities:

  • Lighting adjustments
  • Object removal and addition
  • Style conversion
  • Targeted modifications based on natural language instructions

Required Parameters:

  • prompt - Natural language description of the desired edits (e.g., 'remove the background', 'change lighting to sunset', 'add a hat')

Note: Generated images referenced by generation_result_id are only available for 4 hours after completion. Cost is deducted from your API credits based on feature pricing.

Authorizations

HTTPBearer
TypeHTTP (bearer)

Request Body

JSON
{
"generation_result_id": 0,
"image_url": "",
"prompt": ""
}

Responses

Successful Response
application/json
JSON
{
"generation_id": 0,
"created_at": "string",
"updated_at": "string"
}

Samples

cURL
curl -X POST \
'https://api.uwear.ai/api/v1/generation-edit' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://api.uwear.ai/api/v1/generation-edit', {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-edit';
$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-edit'

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

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