Prompt
How do I generate product images with an AI API?
Latest observation
Oct 11, 2026
OpenAI APIWeb search: off
To generate product images with an AI API, you typically do this:
-
Choose an image-generation model/API
- Examples: OpenAI image models, Stability AI, Midjourney via third-party tools, etc.
- For product images, look for features like:
- high resolution
- background control
- image editing / inpainting
- reference image support
-
Prepare your product inputs
- A clear product photo or 3D render usually works best.
- Optionally include:
- product name
- desired background
- lighting style
- camera angle
- brand colors
- use case/scene
-
Send a prompt or edit request
- If the API supports text-to-image, describe the product scene.
- If it supports image-to-image or editing, upload the product photo and ask the model to place it in a scene or improve the background.
-
Process the returned image
- The API will usually return either:
- a URL to the generated image, or
- base64-encoded image data
- Save it, display it, or send it to your storage/CDN.
- The API will usually return either:
-
Iterate
- Generate several variants.
- Pick the best one or automate selection with human review.
Example workflow for product shots
Prompt example:
“Create a premium studio product photo of a matte black water bottle on a white seamless background, soft shadows, realistic lighting, centered composition, e-commerce style.”
Or for lifestyle shots:
“Place this sneakers product in a modern urban street scene at golden hour, realistic shadows, sharp focus on the shoes, professional advertising photography.”
Example API pattern
Most APIs follow something like:
POST /generate-image
{
"prompt": "premium product photo of a skincare bottle on marble with soft natural light",
"size": "1024x1024"
}
And return something like:
{
"image_url": "https://example.com/generated-image.png"
}
Best practices for product images
- Use a clean source image if editing is supported.
- Be specific about:
- background
- lighting
- angle
- material finish
- brand style
- Avoid overly vague prompts.
- Generate multiple versions for A/B testing.
- Check licensing/commercial-use terms.
If you want a realistic ecommerce result
Use prompts like:
- “studio product photography”
- “e-commerce packshot”
- “softbox lighting”
- “white seamless background”
- “sharp focus”
- “high detail, realistic materials”
If you want, I can help with:
- a Python example
- a JavaScript example
- a prompt template for Amazon/Shopify product images
- a workflow for using a product photo as input