Skip to content
p

P-Image Try-On

Image-to-Imagepruna

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 informationlink
PricingView pricing in the Cloudflare dashboard

Usage

TypeScript
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)
Single Garment

Examples

Turbo PNG — Faster generation with turbo optimizations, returning a PNG.
TypeScript
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)
Turbo PNG

Parameters

output_format
stringrequireddefault: jpgenum: webp, jpg, pngFormat of the saved output image.
output_quality
integerrequireddefault: 95maximum: 100minimum: 0Quality for jpg/webp outputs, from 0 to 100.
person_image
stringrequiredImage of the person to dress. A publicly reachable HTTP(S) URL or a base64 data URI (data:image/...;base64,...).
preserve_input_size
booleanrequireddefault: trueReturn the output at the original input resolution.
prompt
stringrequireddefault: Experimental guidance for non-flatlay garment images, e.g. which garment from which image to use.
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.
seed
integermaximum: 9007199254740991minimum: -9007199254740991Random seed. Leave unset for a random seed.
turbo
booleanrequireddefault: falseRun faster with additional optimizations. Not recommended for more than 4 garments.

API Schemas (Raw)

Input
Output