Use when someone wants virtual try-on — dress a person in clothes from reference photos for fashion or ecommerce.
---
name: p-image-try-on
description: Use when someone wants virtual try-on — dress a person in clothes from reference photos for fashion or ecommerce.
license: MIT
metadata:
version: "1.0.9"
package: pruna-skills
pruna_model: p-image-try-on
---
## Prerequisites
Install and load these skills before generating (skip if already in context via `@pruna`):
| Skill | Description | Install |
| --- | --- | --- |
| `generation-diversity` | Use when writing any generative prompt — ritual seed, explicit structure, scenario axes, and quality gates before paid API calls. | `npx skills add PrunaAI/pruna-skills@generation-diversity -y` |
| `image-prompting` | Use when crafting still-image prompts for any generative model — composition, identity sheets, edits, try-on, and photoreal personas. | `npx skills add PrunaAI/pruna-skills@image-prompting -y` |
| `pruna-api` | Use before any Pruna or Replicate HTTP call — credentials, upload/poll/download, parallel batches, and agent safety. | `npx skills add PrunaAI/pruna-skills@pruna-api -y` |
Or install the full suite once: `npx skills add PrunaAI/pruna-skills@pruna -y`
Follow each skill's **Before generating** / craft sections — do not restate guide content here.
## Agent habit
In the **first reply**, name `` `p-image-try-on` `` in backticks, confirm `PRUNA_API_KEY`, then ask for `person_image` + `garment_images`. Open intake → **`generation-diversity`** clarification intake when silent. When refs need disambiguation, draft with **Prompt craft (dynamic + faithful)** — do not paste skill examples. Redirect background-only / no-garment jobs to `p-image-edit`.
## Prompt craft (dynamic + faithful)
Identity and garments come from **`person_image`** + **`garment_images[]`**. Optional **`prompt`** only **disambiguates refs** — it does not invent a new person or outfit.
| Do | Don't |
| --- | --- |
| Lock **`person_image`** and every **`garment_images[]`** URL first; omit **`prompt`** on clean flat-lays | Describe a new scene, model, or garment the user did not supply |
| When refs are ambiguous: `the green t-shirt from image 1 and the trousers from image 2` (`image-prompting` try-on craft) | Mood-only prompts (`fashion editorial vibe`) or copy this skill's extended example when refs differ |
| Ritual seed before drafting disambiguation wording; vary phrasing when multiple valid mappings exist | Use **`prompt`** for background swaps — redirect to `p-image-edit` |
| Show **`prompt`** (if needed) before `POST` when refs are ambiguous | Silent try-on that changes pose, face, or garments beyond the brief |
**Fidelity check (before pay):** output must still be the user's person in the user's garment(s). If **`prompt`** could apply to a different ref set, rewrite the disambiguation.
## When NOT to use
Use a different skill instead:
| Skill | Description | Install |
| --- | --- | --- |
| `p-image` | Use when someone explicitly wants the fastest, cheapest photo generation — mood boards, bulk panels, or quick iterations — not when controlled photoreal or in-image text is needed. | `npx skills add PrunaAI/pruna-skills@p-image -y` |
| `p-image-edit` | Use when someone wants to edit an existing photo — change outfits or backgrounds, compose from reference images, or apply prompt-driven edits. | `npx skills add PrunaAI/pruna-skills@p-image-edit -y` |
## Pricing
Per generation (same for normal and turbo mode):
- **$0.015** for the first garment
- **$0.008** for each additional garment
Example: 3 garments → $0.015 + 2 × $0.008 = **$0.031**.
## Request shape
One **`person_image`**, one **`garment_images[]` entry per piece** (up to 11), optional **`reference_pose`**. The model auto-classifies each garment — **array order does not matter**. Mixed categories belong in **one call**.
- **`prompt`** — only when a reference shows multiple garments or is worn on-model; clean flat-lays need no prompt.
- **`preserve_input_size: true`** (default) — output dimensions follow the **person** image.
Runware field map: `person` → `person_image`, `garment` → `garment_images[]`, `pose` → `reference_pose`, `positivePrompt` → `prompt`, `settings.turbo` → `turbo`.
## HTTP (curl)
### Upload images
```bash
curl -X POST "https://api.pruna.ai/v1/files" \
-H "apikey: ${PRUNA_API_KEY}" \
-F "content=@/path/to/person.jpg"
curl -X POST "https://api.pruna.ai/v1/files" \
-H "apikey: ${PRUNA_API_KEY}" \
-F "content=@/path/to/garment.png"
```
Use each response `urls.get` in `input.person_image` and `input.garment_images[]`. Optional: `reference_pose`.
### Create (async — recommended)
```bash
curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H "apikey: ${PRUNA_API_KEY}" \
-H 'Model: p-image-try-on' \
-d '{
"input": {
"person_image": "https://api.pruna.ai/v1/files/PERSON_FILE_ID",
"garment_images": ["https://api.pruna.ai/v1/files/GARMENT_FILE_ID"]
}
}'
```
Poll and download: follow `pruna-api`.
Complete the random seed ritual from `generation-diversity` before writing prompts — **do not** pass the ritual string as API `seed`.
### Create (sync — quick test only)
```bash
curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H "apikey: ${PRUNA_API_KEY}" \
-H 'Model: p-image-try-on' \
-H 'Try-Sync: true' \
-d '{
"input": {
"person_image": "https://api.pruna.ai/v1/files/PERSON_FILE_ID",
"garment_images": ["https://api.pruna.ai/v1/files/GARMENT_FILE_ID"]
}
}'
```
### Extended input (turbo + pose + prompt)
```bash
curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H "apikey: ${PRUNA_API_KEY}" \
-H 'Model: p-image-try-on' \
-d '{
"input": {
"person_image": "https://api.pruna.ai/v1/files/PERSON_FILE_ID",
"garment_images": [
"https://api.pruna.ai/v1/files/MULTI_GARMENT_SHOT_ID",
"https://api.pruna.ai/v1/files/BOTTOM_ID"
],
"reference_pose": "https://api.pruna.ai/v1/files/POSE_REF_ID",
"prompt": "the green t-shirt from image 1 and the trousers from image 2",
"turbo": true,
"output_format": "jpg",
"output_quality": 95,
"preserve_input_size": true
}
}'
```
## Before generating
1. Complete Prerequisites guide reading order (`generation-diversity` → `image-prompting` try-on craft).
2. Ritual seed → draft optional **dynamic + faithful** disambiguation **`prompt`** (section above) → confirm **`person_image`**, **`garment_images`** (≤6 for finals; 7–8 usually lands; 9–11 may drop last items), and optional **`turbo`** / **`reference_pose`** / **`prompt`**.
3. **Pruna notes:** one item per body spot (socks + shoes → usually shoes win). **`turbo`** (~2.5–3.5 s) is off by default — not recommended above ~4 garments for finals. Full-body or three-quarter person crops work best. Omit gloves, mittens, handheld props, pocket squares, suspenders, brooches from `garment_images[]`.
## Required input
- `person_image` (string URL)
- `garment_images` (array of string URLs, up to **11**)
## Common optional fields
- `seed`, `output_format` (`webp` / `jpg` / `png`, default `jpg`), `output_quality` (0–100, default 95)
- `preserve_input_size` (boolean, default `true`)
- `turbo` (boolean, default `false`)
- `reference_pose` (person image URL)
- `prompt` (EXPERIMENTAL — disambiguate non-flatlay / multi-garment refs)
## Typical next steps
Common follow-ons after this skill:
| Skill | Description | Install |
| --- | --- | --- |
| `p-image-upscale` | Use when someone wants to upscale or sharpen an existing image for print, large crops, or higher-quality delivery. | `npx skills add PrunaAI/pruna-skills@p-image-upscale -y` |
| `p-video` | Use when someone wants one short video clip from text or images — B-roll, start/end frame animation, or a quick motion shot. Not for full multi-scene films or lip-synced hosts. | `npx skills add PrunaAI/pruna-skills@p-video -y` |
| `p-video-avatar` | Use when someone wants a person on camera speaking a script — lip-synced host, spokesperson, or narrated avatar from a portrait photo. | `npx skills add PrunaAI/pruna-skills@p-video-avatar -y` |
don't have the plugin yet? install it then click "run inline in claude" again.
restructured into implexa's 6 components, added explicit auth/env setup, network/rate-limit edge cases, decision tree for garment count/type/sync strategy, downloadable output contract, and quality-gate outcome signals.
Virtually fit one or more garments onto a person's photo for fashion editorial, ecommerce product showcase, or outfit preview. use this when you have a clear person image (full body or three-quarter view) and one or more garment references (flat-lay, on-model, or multi-item). the model keeps identity, pose, hair, background, and scene props intact while swapping only the clothing, making it strong for complex prints, patchwork, and multi-garment stacks. run this before upscaling, animating, or packing results into ecommerce workflows.
External connection: Pruna API (pruna.ai)
PRUNA_API_KEY environment variable (create at https://console.pruna.ai)Required images (upload first via multipart form to https://api.pruna.ai/v1/files):
person_image , photo of person to dress (full body or three-quarter; clear view of target body regions; not tight crops)garment_images[] , array of up to 11 garment references; each item is one URL returned from file uploadOptional images:
reference_pose , person photo showing desired pose/angle; output will match this person's postureParameters (optional):
prompt (string, EXPERIMENTAL) , disambiguate when garment image shows multiple items or garment worn by someone else; e.g., "the green t-shirt from image 1 and the trousers from image 2"turbo (boolean, default false) , enable for speed (~2.5-3.5 s) at slight quality cost; disabled by defaultseed (integer) , random seed for reproducibility; omit for randomoutput_format (string, default "jpg") , "jpg", "webp", or "png"output_quality (integer, default 95) , 0-100 for jpg/webppreserve_input_size (boolean, default true) , output dimensions match person_image; model resizes internallyConfirm inputs with user. Gather person photo, garment images (up to 11; target 6 or fewer for delivery assets), and optional pose reference or prompt. validate that person image clearly shows body regions to dress.
Upload person image. POST multipart form to https://api.pruna.ai/v1/files with content=@/path/to/person.jpg header apikey: ${PRUNA_API_KEY}. capture response field urls.get (this is the file ID URL).
Upload each garment image. repeat step 2 for every garment reference. store each response urls.get.
Derive seed (if applicable). follow Pruna's random-seed-ritual , sum modulo method , if reproducibility is required. otherwise omit seed.
Build try-on request. POST to https://api.pruna.ai/v1/predictions with headers Content-Type: application/json, apikey: ${PRUNA_API_KEY}, Model: p-image-try-on. body: { "input": { "person_image": "<person URL>", "garment_images": ["<garment URL 1>", ...], ... } }. include optional fields (turbo, reference_pose, prompt, output_format, output_quality, preserve_input_size) only if user specified them.
Choose sync or async. for fast single-garment jobs, add header Try-Sync: true (synchronous; wait up to 30s for result). for production multi-garment or reliability-critical flows, omit Try-Sync and poll instead (step 7).
Poll for completion (async only). capture response id (prediction ID). every 1-2 seconds, GET https://api.pruna.ai/v1/predictions/<id> with auth header. loop until status === "succeeded" or error. timeout after 5 minutes (if still pending, flag timeout; user retries or escalates).
Extract output. on success, response field output contains object with image (image URL) and optional image_seed (actual seed used). download image via GET to image URL (no auth required).
Run quality checklist. open output image locally; apply p-image-try-on-quality-checklist.md , confirm all garments applied, no artifacts, person identity/pose preserved, no mushy AI artifacts, output resolution matches person_image if preserve_input_size: true.
Deliver or iterate. if pass, save/deliver image. if fail or partial application (e.g., 5 of 6 garments applied), either adjust inputs (remove problematic garment, use prompt to disambiguate, try turbo off) and rerun, or confirm with user that result is acceptable.
if user wants speed and has ≤4 garments: enable turbo: true. turbo mode runs ~2.5-3.5 s regardless of garment count, but pruna recommends normal mode for ≤4 pieces (turbo sweet spot ~4); for 5+ garments, normal mode has higher fidelity. cost is identical.
if garment image shows multiple items or is worn on-model: provide prompt to name which garment from which image (EXPERIMENTAL). example: "the green t-shirt from image 1 and the trousers from image 2". omit prompt for clean flat-lays (model auto-classifies single-item shots).
if user needs specific pose or angle: upload a reference person image and set reference_pose to that URL. output person will match the reference pose. omit if user is happy with person_image's pose.
if garment count is 7-11: understand that 7-8 items usually apply successfully, but 9-11 may drop the last pieces. if loss is unacceptable, split into two jobs (e.g., top/bottom stack in first call, shoes/hat in second call). if user wants all 11 guaranteed, advise that single-call is best-effort.
if garment type is in the omit list (gloves, mittens, arm warmers, handheld props, pocket squares, suspenders, brooches): skip it from garment_images[]. model will not apply it, and including it wastes a slot and adds cost.
if person image is very tight crop or lacks clear body region: reject and ask for wider crop or different pose. output will artifact or miss garment application.
if sync mode times out (after 30s no response): fall back to async polling (omit Try-Sync header) and retry.
if async poll times out after 5 minutes: flag network or backend issue. user retries; if persistent, check pruna status page or contact support.
if output shows partial application (e.g., 3 of 5 garments applied, no error reported): this is a model limitation, not a failure. confirm with user; if unacceptable, adjust inputs (reduce garment count, remove ambiguous items, enable turbo off) and rerun.
if user wants to restyle one piece: keep person_image and unchanged garment_images[] URLs; swap only the URL for the piece being changed, rerun. cost is per-generation, so each variant is charged anew.
On success (status: "succeeded"):
output.image contains a signed, temporary URL to the try-on result image.person_image if preserve_input_size: true (default); otherwise, model's native output size (typically 512x512 or 768x768 depending on input).output_format parameter (jpg, webp, or png).output.image_seed (if seed was provided or generated) is included for reproducibility.Download the image:
output.image URL directly (no auth required); URL expires after 24 hours.On failure (status: "failed"):
error contains a string message (e.g., "Person image must show at least one person", "Garment upload failed").output field present.Edge cases:
PRUNA_API_KEY and retries.The skill worked if:
output.image URL and image downloads without 404.person_image.If any of steps 1-8 fail, the outcome is: alert user, provide error details or partial results, and offer retry path (adjust inputs, reduce garment count, try turbo mode, or escalate to support).
references & credits: