Generate studio-quality product photos by placing your product in custom scenes. Perfect for ecommerce, Amazon listings, Shopify stores, and brand marketing. Remove backgrounds, add professional backgrounds, and create consistent product imagery at scale via REST API.
Get list of pre-defined professional scene templates for product photography. Includes studio setups, lifestyle scenes, holiday themes, and ecommerce-ready backgrounds.
curl -X GET 'https://codingmantra.com/api/image/product-photography-prompts'{
"data": [
{
"id": "minimalist-white",
"title": "E-commerce White Background",
"categoryId": "studio-minimalist",
"categoryTitle": "Studio & Minimalist",
"demoImageUrl": "https://..."
},
// ... more prompts
]
}Get all available AI image generation models with capabilities, supported resolutions, pricing per resolution, and estimated credit costs. Use this to dynamically check model availability and costs before generating images.
curl -X GET 'https://codingmantra.com/api/image/image-model-options'{
"data": [
{
"model": "standard",
"modelId": "googleai/gemini-2.5-flash-image",
"name": "Gemini 2.5 Flash",
"provider": "Google AI",
"description": "Fast and affordable...",
"badge": "Cost-Effective",
"supportedResolutions": ["1K"],
"supportsVariableResolution": false,
"supportsBatchGeneration": true,
"maxBatchSize": 10,
"defaultResolution": "1K",
"estimatedCost": { "credits": 10, "usd": 0.09, "inr": 5 },
"pricingPerResolution": {
"1K": { "credits": 10, "usd": 0.09, "inr": 5 }
}
},
// ... more models
]
}Generate a professional product photograph with AI. Send product images and scene descriptions to create studio-quality ecommerce-ready product photos with automatic background removal, custom backgrounds, logo overlay, and text marketing. Supports batch generation for multiple products at once.
Note: Either `promptId` or `scenePrompt` is required.
| Parameter | Type | Description |
|---|---|---|
| productImages | Array of Objects | Required. Array of product images to place in the scene. Each object must contain either a dataUrl (Base64 data URI) or a url (public HTTPS URL). Supports JPEG, PNG, WebP. Optional label for product identification and prompt for individual product instructions. Maximum batch size varies by model (up to 10 images with standard model). |
| promptId | string | Optional. Pre-defined scene template ID for professional product photography. Use /api/image/product-photography-prompts to get available scene IDs. Examples: minimalist-white, rustic-wood-table, luxury-box. |
| scenePrompt | string | Optional. Custom scene description for the product background. Can describe lighting, setting, props, colors, or mood. Examples: in a cozy coffee shop with warm lighting, on marble countertop with fresh flowers. Use alone or with promptId to customize. |
| logoImage | string | Optional. Brand logo to overlay on the product image. Provide as data URI (Base64) or public HTTPS URL. Supports PNG with transparency. Use with logoPlacement and logoSize for positioning. |
| logoPlacement | string | Optional. Logo position on the image. Options: top-left, top-center, top-right, center-left, center, center-right, bottom-left, bottom-center, bottom-right. Default: bottom-right. |
| logoSize | number | Optional. Logo size as percentage of image (0.1 to 0.8). Default: 0.15 (15% of image width). |
| referenceImage | string | Optional. Reference image URL or data URI to guide the style, lighting, color palette, and composition of the generated product photo. |
| overlayText | string | Optional. Short text overlay on the product image. Great for promotional banners, sale badges, or brand taglines. Positioned prominently on the generated image. |
| marketingText | string | Optional. Longer marketing text or slogan to integrate into the product scene. More detailed than overlayText for storytelling. |
| model | string | Optional. AI model slug for image generation. Use pro for highest quality (Gemini 3 Pro), standard for fast bulk generation (Gemini 2.5 Flash), or flash for balanced speed/quality (Gemini 3.1 Flash). Default: pro. Call /api/image/image-model-options for latest models. |
| resolution | string | Optional. Output image resolution. Options: 1K (1024px), 2K (1536px), 4K (2048px). Not all models support all resolutions. Default: Maximum supported resolution for selected model (e.g., 4K for pro, 1K for standard). |
| aspectRatio | string | Optional. Desired output aspect ratio. Options: 1:1 (Square - Instagram posts), 4:3, 3:4, 16:9 (Landscape - YouTube thumbnails), 9:16 (Story/Reel), 4:5 (Portrait), 3:2, 2:3, 21:9 (Ultrawide). Default: 1:1. |
| outputResult | string | Optional. Output format. base64 returns Base64 data URI (default for quick integration). url returns hosted image URLs from Google Cloud Storage (better for production use and CDN delivery). |
curl -X POST 'https://codingmantra.com/api/image/product-photography' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"productImages": [
{ "url": "https://example.com/my-product.png", "label": "bottle" }
],
"promptId": "rustic-wood-table",
"scenePrompt": "with grapes and cheese",
"logoImage": "https://example.com/my-logo.png",
"logoPlacement": "bottom-right",
"logoSize": 0.15,
"aspectRatio": "16:9",
"outputResult": "url"
}'{
"data": {
"imageUrl": "https://storage.googleapis.com/...",
"thumbnailUrl": "https://storage.googleapis.com/..."
}
}{
"data": {
"photoDataUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}
}