Our AI Undress API offers quick and accurate undressing effects. Integrate it to enhance user experience.
file_url and mask_url must be in the white domain.
import requests, time
API_KEY = "testkey"
url = "https://api.undresswith.ai/undress_api/undress"
params = {
"file_url": "https://cdn.undresswith.ai/undresswith/images/6bde64bf9ab1aacc5b58322a2eaf8e75.jpg",
"mask_url": "https://cdn.undresswith.ai/undresswith/masks/bd442106ef2c25097580d47ef5926405.jpeg",
"prompt": "Nude",
"num_images": 2,
"ai_model_type": 0,
"width": 512,
"height": 680
}
headers = {
'Content-Type': 'application/json; charset=UTF-8',
'Accept': 'application/json; charset=UTF-8',
'X-Api-Key': API_KEY
}
response = requests.post(url, json=params, headers=headers)
response.raise_for_status()
print(response.json())
Request Parameters:
{
"file_url": "string, URL of the image to process, jpg or png format",
"mask_url": "string, URL of the mask image to process (optional). If not provided, a mask will be auto-generated. Auto-generated masks may have some limitations, so providing a custom mask is recommended",
"prompt": "string, text prompt for the AI model",
"num_images": "integer (1-2), number of images to generate",
"ai_model_type": "integer, 0: Basic (50 Gems * num_images), 1: Advanced (55 Gems * num_images)",
"width": "integer, input image width, maximum 1024",
"height": "integer, input image height, maximum 1024"
}
Response:
{
"code": 1,
"message": "success",
"data": {
"uid": "92d5dfb9230da41e908ec72b4db13f8d",
"estimated_time": 20 // (seconds) The estimated time to complete the task
}
}