Initiate a new try-on generation.
import requests
response = requests.post(
"https://vto.face-swap.co/run",
headers={"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"},
json={
"model_image": "https://huggingface.co/spaces/tonyassi/Virtual-Try-On-Pro/resolve/main/examples/kim1.jpg",
"garment_image": "https://huggingface.co/spaces/tonyassi/Virtual-Try-On-Pro/resolve/main/examples/kim2.jpg",
"category": "one-pieces",
},
)
curl -X POST https://vto.face-swap.co/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-d '{
"model_image": "https://huggingface.co/spaces/tonyassi/Virtual-Try-On-Pro/resolve/main/examples/kim1.jpg",
"garment_image": "https://huggingface.co/spaces/tonyassi/Virtual-Try-On-Pro/resolve/main/examples/kim2.jpg",
"category": "one-pieces"
}'
fetch('https://vto.face-swap.co/run', {
method: 'POST',
body: JSON.stringify({
model_image: "https://huggingface.co/spaces/tonyassi/Virtual-Try-On-Pro/resolve/main/examples/kim1.jpg",
garment_image: "https://huggingface.co/spaces/tonyassi/Virtual-Try-On-Pro/resolve/main/examples/kim2.jpg",
category: "one-pieces"
}),
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
}
});
category
Required
'one-pieces' | 'tops' | 'bottoms'
The category specifies the type of garment. Choose from 'one-pieces' for full outfits, dresses, and jumpsuits. 'tops' for upper body garments, shirts and jackets.'bottoms' for lower body items, skirts, and pants.
200
The reponse will return the id of the prediction which you will need to use for getting the status and result.
{
"id": "123a87r9-4129-4bb3-be18-9c9fb5bd7fc1-u1",
"error": null
}