p-image-try-on
Virtually fit one or more garments onto a person's photo
Virtually fit one or more garments onto a person's photo
p-image-try-on is Pruna's virtual try-on model that fits garments onto a person's photo. Provide a photo of a person and garment reference images, and the model will realistically dress the person in the provided garments.
Rate Limit: 500 requests per minute
Category: Image Editing
Price: 0.015$ for the first image input, plus 0.008$ for each additional image input
# Upload person photo
curl -X POST "https://api.pruna.ai/v1/files" \
-H "apikey: YOUR_API_KEY" \
-F "content=@/path/to/person.jpg"
# Upload garment image
curl -X POST "https://api.pruna.ai/v1/files" \
-H "apikey: YOUR_API_KEY" \
-F "content=@/path/to/garment.png"
Note: Use -F (form) with @ prefix to upload a file from your local filesystem. The file path should be absolute or relative to your current directory.
curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H 'apikey: YOUR_API_KEY' \
-H 'Model: p-image-try-on' \
-H 'Try-Sync: true' \
-d '{
"input": {
"person_image": "https://your-url.com/person.jpg",
"garment_images": ["https://your-url.com/garment.png"],
"prompt": ""
}
}'
curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H 'apikey: YOUR_API_KEY' \
-H 'Model: p-image-try-on' \
-d '{
"input": {
"person_image": "https://your-url.com/person.jpg",
"garment_images": ["https://your-url.com/garment.png"],
"prompt": ""
}
}'
| Parameter | Type | Description |
|---|---|---|
| person_image | string | Image URL of the person to edit |
| garment_images | array of string | Garment reference images. Up to 6 recommended, up to 11 supported. |
| Parameter | Type | Default | Description |
|---|---|---|---|
| seed | integer | — | Random seed. Leave blank for a random seed. |
| prompt | string | "" | Experimental guidance for non-flatlay garment images, e.g. which garment from which image to use. |
| turbo | boolean | false | Run faster with additional optimizations. Not recommended for more than 4 garments. |
| output_format | string | jpg | Format of the saved output image (webp, jpg, png). |
| output_quality | integer | 95 | Quality for jpg/webp outputs from 0 to 100. |
| reference_pose | string | — | EXPERIMENTAL: Optional reference pose image. When provided, the person is reposed to match this reference before virtual try-on. Might fail for some seeds. |
| preserve_input_size | boolean | true | Return the output at the original input resolution. |