- Third-party
Pruna's P-Image Try-On virtually fits one or more garments onto a person's photo. Provide a photo of a person plus garment reference images and the model realistically dresses the person in the provided garments.
| Model Info | |
|---|---|
| More information | link ↗ |
| Pricing |
|
const response = await env.AI.run(
'pruna/p-image-try-on',
{
person_image:
'https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/human/00121_00.jpg',
garment_images: [
'https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/cloth/04469_00.jpg',
],
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "pruna/p-image-try-on",
"input": {
"person_image": "https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/human/00121_00.jpg",
"garment_images": [
"https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/cloth/04469_00.jpg"
]
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/pruna/p-image-try-on/single-garment.jpg"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}Turbo PNG — Faster generation with turbo optimizations, returning a PNG.
const response = await env.AI.run(
'pruna/p-image-try-on',
{
person_image:
'https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/human/00121_00.jpg',
garment_images: [
'https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/cloth/09163_00.jpg',
],
turbo: true,
output_format: 'png',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "pruna/p-image-try-on",
"input": {
"person_image": "https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/human/00121_00.jpg",
"garment_images": [
"https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/cloth/09163_00.jpg"
],
"turbo": true,
"output_format": "png"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/pruna/p-image-try-on/turbo-png.png"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}person_image
stringrequiredImage of the person to dress. A publicly reachable HTTP(S) URL or a base64 data URI (data:image/...;base64,...).▶garment_images[]
arrayrequiredminItems: 1maxItems: 11Garment reference images to fit onto the person. Each entry is an HTTP(S) URL or a base64 data URI. Up to 6 recommended, up to 11 supported.prompt
stringrequireddefault: Experimental guidance for non-flatlay garment images, e.g. which garment from which image to use.seed
integerminimum: -9007199254740991maximum: 9007199254740991Random seed. Leave unset for a random seed.turbo
booleanrequireddefault: falseRun faster with additional optimizations. Not recommended for more than 4 garments.output_format
stringrequireddefault: jpgenum: webp, jpg, pngFormat of the saved output image.output_quality
integerrequireddefault: 95minimum: 0maximum: 100Quality for jpg/webp outputs, from 0 to 100.reference_pose
stringOptional reference pose image (HTTP(S) URL or data URI). When provided, the person is reposed to match this reference before virtual try-on.preserve_input_size
booleanrequireddefault: trueReturn the output at the original input resolution.image
stringformat: uriPresigned URL for the generated try-on image.