Prompt

How do I generate product mockup images from a prompt using an API?

Artificial Intelligence / AI Content Generation1 observationLast seen Oct 11, 2026

Latest observation

Oct 11, 2026OpenAI APIWeb search: off

You can generate product mockup images from a text prompt with an image-generation API in a fairly standard flow:

  1. Describe the product and scene in the prompt
  2. Call the image generation endpoint
  3. Download or store the returned image
  4. Optionally post-process the image in your app

Typical prompt structure

A good mockup prompt usually includes:

  • Product type: t-shirt, mug, box, bottle, phone case, tote bag, etc.
  • Style: minimal, premium, studio-lit, lifestyle, flat lay
  • Background: white seamless, concrete, desk, outdoor
  • Branding placement: centered logo, wraparound label, front-facing design
  • Render quality: photorealistic, high detail, soft shadows

Example prompt:

"Photorealistic product mockup of a matte black coffee mug on a clean white studio background, centered composition, soft shadow, premium e-commerce style, blank label area, high resolution"

API example

If you’re using an image generation API, the request often looks like this conceptually:

import requests

API_KEY = "your_api_key"

payload = {
    "prompt": "Photorealistic product mockup of a black hoodie on a plain white background, studio lighting, front view, high detail",
    "size": "1024x1024",
    "n": 1
}

response = requests.post(
    "https://api.your-image-provider.com/v1/images/generate",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json=payload
)

data = response.json()
print(data)

The response usually includes either:

  • a URL to the generated image, or
  • base64-encoded image data

If you want consistent mockups

For product mockups, pure text-to-image can be inconsistent. Better options are:

  • Use a reference image of the product
  • Use image editing / inpainting to place your design onto an existing blank template
  • Use control inputs like a masked area or template image if the API supports it

This is often the best approach for:

  • t-shirts
  • posters
  • packaging
  • labels
  • phone cases

Good prompt tips

To get better results:

  • Be specific about camera angle: front view, top-down, 3/4 angle
  • Mention lighting: soft studio light, natural window light
  • Mention background: isolated on white, lifestyle setting
  • Mention material: glossy ceramic, matte fabric, brushed aluminum
  • Avoid overly complex scenes if you want a clean mockup

Example prompts by product

T-shirt

"Premium apparel mockup of a white oversized t-shirt laid flat on a light gray background, subtle fabric texture, front view, realistic shadows, blank chest area for design placement"

Mug

"Photorealistic ceramic mug mockup, white mug with handle facing right, on a clean studio background, soft shadow, blank printable area, e-commerce product photo"

Box packaging

"Luxury packaging mockup of a rectangular cardboard box with minimal branding, white seamless background, soft studio lighting, front angle, high detail"

Important note

If your goal is to place your exact logo or artwork onto the mockup, a generative image model may not reproduce it perfectly. In that case, use:

  • a mockup template
  • image compositing
  • or an API that supports editing with masks / image-to-image

If you want, I can give you:

  • a Python example for a specific API,
  • a Node.js example,
  • or a ready-made prompt template for e-commerce mockups.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.