CodingMantra LogoCodingMantra
GalleryProductsPortfolioServicesGamesPricingContact
  1. Home
  2. API Documentation
  3. Image Tools
  4. Product Try-On

Product Try-On API

Virtually try on products (apparel, accessories, etc.) on models or scenes.

GET
/api/image/product-try-on-prompts

Retrieve a list of all available pre-defined scene instructions for the Product Try-On endpoint.

Example Request

curl -X GET 'https://codingmantra.com/api/image/product-try-on-prompts'

Example Response

{
  "data": [
    {
      "id": "try-on-suit",
      "title": "Suit / Jacket on Model",
      "categoryId": "fashion-apparel",
      "categoryTitle": "👗 Fashion & Apparel",
      "demoImageUrl": "https://..."
    },
    // ... more prompts
  ]
}

POST
/api/image/product-try-on

Virtually try on products on a model or place them in a generated scene.

Request Body

FieldTypeDescription
productImagesArray of ObjectsRequired. An array of product image objects. Each object must have either a `dataUrl` or `url`. Supports optional `label` and `prompt`.
mainImagestringOptional. A data URI or URL of a person or scene to place the product on. If omitted, an AI model/scene will be generated.
promptstringOptional. Additional instructions for the scene or model style.
logoImagestringOptional. A data URI or URL of a logo to place on the image.
logoPlacementstringOptional. Instructions for logo placement (e.g., 'top-left', 'center').
logoSizenumberOptional. A numeric value (0.1 to 0.5) representing the logo size as a percentage of the image.
referenceImagestringOptional. A data URI or URL of a reference image to guide the style.
aspectRatiostringOptional. Default: `'1:1'`.
outputResultstringOptional. `'base64'` (default) or `'url'`.

Example Request

curl -X POST 'https://codingmantra.com/api/image/product-try-on' \
     -H 'Content-Type: application/json' \
     -H 'Authorization: Bearer YOUR_API_KEY' \
     -d '{
          "productImages": [
            { "url": "https://example.com/jacket.png", "label": "leather jacket" }
          ],
          "mainImage": "https://example.com/model.jpg",
          "prompt": "urban street style",
          "aspectRatio": "3:4"
        }'

Example Response

{
  "data": {
    "photoDataUri": "data:image/png;base64,..."
  }
}

On This Page

GET PromptsPOST Product Try-OnFAQ

Frequently Asked Questions

CodingMantra LogoCodingMantra

Providing business solutions for small and medium-sized businesses and helping them to grow.

WhatsApp ChannelX / TwitterLinkedInInstagramFacebookGitHubYouTube

Company

  • About Us
  • Services
  • Products
  • Portfolio
  • Pricing
  • Blog
  • API Docs
  • Contact Us

Top Tools

  • All Tools
  • Image Gallery
  • Image Tools
  • Digital Marketing
  • Financial Tools
  • Games
  • SEO Tools

Legal

  • Privacy Policy
  • Terms & Conditions
  • Return Policy
  • Deals
  • Sitemap

© 2026 CodingMantra. All Rights Reserved.