AI Virtual Try-On (Kling)
Upload a model image + a flat-lay garment image, get a composite in 25 seconds. Results can be used in product pages, live stream marketing, or chained into video generation.
Entry
- Blogger:
/blogger-admin/tryon/generator - Admin:
/admin/tryon/generator(acting-as a blogger, charges admin AI wallet)
Three Model Image Sources
| Source | Description |
|---|---|
| My Models | Your own uploaded model library ("My Models") |
| Platform Models | Shared library uploaded by platform admin, available to all bloggers |
| Temporary Upload | Single-use image, not added to library |
Two Garment Sources
- Product AJAX search — search by product name; system uses the product's AI Try-On reference image (flat-lay) first, falls back to first product image if empty
- Direct upload — upload a temporary flat-lay image, single-use
⚠️ Tip: Kling works best with white-background flat-lay garments. For apparel products, upload a dedicated AI Try-On reference image (at the bottom of product edit page) — don't use product images with models wearing the garment.
Generation & Wait
- Pick model + pick garment → click "Generate"
- System charges + calls Kling API
- Frontend polls every 2 seconds, ~25s output (10-min timeout = auto-refund)
- Result image immediately downloaded to Cloudflare R2 (avoid Kling 30-day expiry)
Chain to Video
After try-on completes, click "→ Generate Video":
- Try-on result becomes video starting frame
- Video task links back via try-on task ID
- Video list traceable back to original try-on
Pricing
- RM 3.00 per run (price configurable in platform admin "AI Service Pricing")
- Charged from admin AI wallet
- Failed runs auto-refunded + quota restored
- Up to 3 concurrent try-on tasks per blogger
- Monthly limit: default 30 runs/blogger (AI Try-On quota, independent counting)
Deletion
Deleting a try-on record cascades:
- R2 file deleted (if uploaded)
- Linked video tasks' try-on reference set to NULL (migration 049)