Loading...
Loading...
Virtual try-on: clothing, accessories, hairstyles, makeup, glasses, hats, shoes, watches. Use when the user wants to see how an item looks on a person — e.g. "try on this dress", "put these glasses on me", "show me with this hairstyle", "what would I look like in this outfit".
npx skill4agent add starchild-ai-agent/official-skills image-tryonexec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_path="uploads/person.jpg",
garment_path="uploads/dress.jpg",
category="clothing",
)
# result -> {"success": True, "images": [{"local_path": "output/images/..."}], ...}exec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_url="https://example.com/person.jpg",
garment_url="https://example.com/jacket.jpg",
category="clothing",
)exec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_path="uploads/face.jpg",
garment_path="uploads/sunglasses.jpg",
category="glasses",
)local_pathoutput/images/xxx.pngoutput/images/send_to_telegram(file_path="output/images/...", message_type="image")send_to_wechat(file_path="output/images/...", message_type="image")| Parameter | Required | Default | Description |
|---|---|---|---|
| yes* | — | Local workspace file path to the person's photo |
| yes* | — | Public HTTPS URL of the person's photo |
| yes* | — | Local workspace file path to the garment/item photo |
| yes* | — | Public HTTPS URL of the garment/item photo |
| no | | Try-on category key (see §5) |
| no | | Custom prompt — overrides category default when set |
| no | | Model: |
| no | | Output ratio: |
person_pathperson_urlgarment_pathgarment_urlpromptcategory| User says | Category | Key |
|---|---|---|
| "try on this dress/shirt/jacket/outfit" | Clothing | |
| "put this necklace/scarf/bag on me" | Accessory | |
| "show me with this hairstyle/hair color" | Hairstyle | |
| "apply this makeup/lipstick look" | Makeup | |
| "try on these glasses/sunglasses" | Glasses | |
| "put this hat/cap/beanie on me" | Hat | |
| "try on these shoes/sneakers/boots" | Shoes | |
| "put this watch on my wrist" | Watch | |
| Category | Key | Best for | Photo requirements |
|---|---|---|---|
| Clothing | | Shirts, dresses, jackets, pants, coats, full outfits | Full body or upper body person photo |
| Accessory | | Scarves, bags, belts, jewelry, necklaces, earrings | Relevant body area visible |
| Hairstyle | | Haircuts, hair colors, styling changes | Clear face/head photo |
| Makeup | | Lipstick, eyeshadow, foundation, blush, full looks | Clear face close-up |
| Glasses | | Prescription glasses, sunglasses, reading glasses | Clear face photo, front-facing |
| Hat | | Caps, beanies, fedoras, sun hats, helmets | Head and shoulders visible |
| Shoes | | Sneakers, heels, boots, sandals, loafers | Full body or lower body photo |
| Watch | | Analog, smartwatches, luxury watches | Wrist/arm visible |
| Model | Key | Speed | Quality | Best for |
|---|---|---|---|---|
| NanoPro | | ~25s | Good | Default for all requests. Fast iteration. |
| GPT Image 2 | | ~150s | Best | When user explicitly asks for "highest quality" or "best quality". |
nanoprogptnanopro# Default (fast)
result = try_on(person_path="me.jpg", garment_path="dress.jpg", category="clothing")
# High quality (user requested)
result = try_on(person_path="me.jpg", garment_path="dress.jpg", category="clothing", model="gpt")exec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_path="uploads/person_fullbody.jpg",
garment_path="uploads/summer_dress.jpg",
category="clothing",
)exec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_path="uploads/portrait.jpg",
garment_path="uploads/gold_necklace.jpg",
category="accessory",
)exec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_path="uploads/face.jpg",
garment_path="uploads/bob_hairstyle.jpg",
category="hairstyle",
)exec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_path="uploads/face_closeup.jpg",
garment_path="uploads/evening_makeup.jpg",
category="makeup",
)exec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_path="uploads/face_front.jpg",
garment_path="uploads/aviator_sunglasses.jpg",
category="glasses",
)exec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_path="uploads/head_shoulders.jpg",
garment_path="uploads/fedora_hat.jpg",
category="hat",
)exec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_path="uploads/person_fullbody.jpg",
garment_path="uploads/white_sneakers.jpg",
category="shoes",
)exec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_path="uploads/wrist_photo.jpg",
garment_path="uploads/luxury_watch.jpg",
category="watch",
)exec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_path="uploads/person.jpg",
garment_path="uploads/vintage_jacket.jpg",
category="clothing",
prompt="The person is wearing the vintage leather jacket from the second image, styled with a casual street fashion look. Keep the person's face and body exactly the same. Add realistic leather texture and natural draping.",
)exec(open('skills/image-tryon/try_on.py').read())
result = try_on(
person_path="uploads/person.jpg",
garment_path="uploads/outfit.jpg",
category="clothing",
aspect_ratio="9:16", # Full-length portrait
)| Category | Recommended photo type | Tips |
|---|---|---|
| Clothing | Full body, front-facing | Arms slightly away from body, neutral pose |
| Accessory | Relevant body area visible | Good lighting on the area where accessory goes |
| Hairstyle | Clear head/face, front or 3/4 view | Hair pulled back or current style clearly visible |
| Makeup | Face close-up, front-facing | Clean face, good even lighting, no heavy makeup |
| Glasses | Face front-facing, eyes visible | No existing glasses, clear eye area |
| Hat | Head and shoulders, front-facing | No existing hat, hair visible |
| Shoes | Full body or legs/feet visible | Standing pose, current shoes visible |
| Watch | Wrist/forearm visible | Bare wrist or current watch visible |
prompt[person preservation] + [item description] + [fit/positioning] + [style/mood] + [quality anchors]The person is wearing the navy blue suit from the second image. Keep the person's face, body, and pose exactly the same. The suit should fit perfectly with proper tailoring — clean shoulder line, correct sleeve length, natural lapel lay. Professional fashion photography quality with studio lighting.The person is wearing the oversized hoodie from the second image in a relaxed street style. Keep the person's identity and pose the same. The hoodie should drape naturally with realistic fabric weight and casual fit. Urban photography style.The person is wearing the diamond pendant necklace from the second image. Keep everything about the person the same. The necklace should sit naturally on the collarbone with realistic sparkle and light reflections. The chain length and pendant size should be proportional to the person's frame.| Error | Cause | Solution |
|---|---|---|
| "Person image error: Either person_path or person_url must be provided" | Missing person photo | Ask user for their photo |
| "Garment/item image error: Either garment_path or garment_url must be provided" | Missing item photo | Ask user for the item photo |
| "File not found" | Invalid file path | Check the file path and try again |
| "Unsupported image format" | Non-image file | Use JPG, PNG, or WebP |
| "Image too large" | File > 10 MB | Resize or compress the image |
| "Unknown category" | Invalid category key | Use one of the 8 valid categories |
| Low quality result | Poor input photos | Use higher resolution, well-lit photos |
| Wrong item placement | Unclear body positioning | Use front-facing photos with target area visible |
image-editimage-portraitimage-createimage-create