AI Product Mockup Generation API — Device & Packaging Mockups
A two-person app team needs six App Store screenshots showing the product on an iPhone, in someone's hand, on a desk next to a coffee cup — by Friday, for a launch that might slip. Buying a mockup template pack means hunting for a scene that matches the brand, then fighting Photoshop smart objects to drop the screenshot in at the right perspective. Generating the same scenes through an API call, with the actual screenshot or product photo passed in as a reference, turns that into a few requests instead of an afternoon in a design tool.
This guide covers which GenRelay image model fits which kind of mockup, two working code examples (a reference-guided scene and an instruction-based edit), how to keep a mockup set visually consistent, and what a full set costs to generate.
Can I Generate Realistic Mockups via API Instead of a Photographer or Template Pack?
Yes — reference-guided image generation places an existing product photo, screenshot, or flat design into a new scene generated around it, rather than selecting from a fixed library of pre-shot templates. Instead of finding a stock mockup where the phone angle happens to match your screenshot, you describe the scene ("phone on a wooden desk, morning light, screenshot visible on screen") and the model composes it around the image you supply.
Definition: reference-guided generation is an image generation mode where an input image (a product photo, logo, or screenshot) anchors part of the output, while the surrounding scene, lighting, and composition are generated from the text prompt. It's the mechanism that makes mockup generation work — the product itself stays recognizable while everything around it is new.
Which Model Should I Use for Mockup Generation?
The choice depends on whether you're compositing onto an existing template or generating a new scene from scratch.
| Task | Best model | Why |
|---|---|---|
| Place a screenshot/logo onto an existing photo (e.g., add a logo to a box template) | GPT-image-2 | Instruction-based editing on a supplied image |
| Generate a new scene around a product photo (e.g., "phone on a desk," "box in someone's hand") | Nano Banana Pro | Reference-guided generation with strong scene composition |
| Bulk-generate simple variations (multiple angles, color variants) | Nano Banana 2 | Lower per-image cost for high-volume, simpler compositions |
Nano Banana Pro is the default for anything where the scene itself matters — App Store screenshots, social media product shots, pitch-deck packaging renders. GPT-image-2 is faster and cheaper when you already have a mockup template and just need something dropped onto it.
How Do I Generate a Device Mockup Scene from a Screenshot?
Pass the screenshot as a reference image and describe the scene you want it placed into.
import requests
import os
API_KEY = os.environ["GENRELAY_API_KEY"]
BASE_URL = "https://genrelay.ai/v1"
def generate_mockup(screenshot_url, scene_prompt, size="1024x1024"):
response = requests.post(
f"{BASE_URL}/images/generations",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
},
json={
"model": "nano-banana-pro",
"prompt": scene_prompt,
"reference_image_url": screenshot_url,
"size": size
}
)
return response.json()["data"][0]["url"]
mockup_url = generate_mockup(
screenshot_url="https://cdn.example.com/app-screenshot-onboarding.png",
scene_prompt=(
"iPhone 15 held in a hand against a blurred coffee shop background, "
"screenshot visible on the screen at a natural viewing angle, soft morning light"
),
size="1024x1536"
)
The reference_image_url field is what keeps the screenshot itself unaltered while the model generates the hand, phone body, and background around it.
How Do I Place a Logo onto an Existing Packaging Template?
If you already have a packaging photo and just need a logo or label design applied, use GPT-image-2's instruction-based editing instead of generating a new scene.
def edit_packaging(template_url, instruction):
response = requests.post(
f"{BASE_URL}/images/edits",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"model": "gpt-image-2",
"image_url": template_url,
"prompt": instruction
}
)
return response.json()["data"][0]["url"]
result_url = edit_packaging(
template_url="https://cdn.example.com/box-template-blank.png",
instruction="Apply this brand's logo and 'Cold Brew Concentrate' text to the front panel, matte black finish"
)
Editing an existing template is cheaper and more predictable than generating packaging geometry from scratch when the box shape and lighting are already correct.
How Do I Keep a Full Mockup Set Visually Consistent?
Reuse the same reference image and prompt scaffold across every generation in a set, changing only the scene-specific detail (angle, background, accessory). Six screenshots meant to look like one coherent App Store gallery should share the same lighting description, camera distance, and prop style — vary only what needs to differ (screen content, device color). This is the same reference-guided consistency pattern covered in more depth in maintaining visual consistency across AI-generated images; mockups are a direct application of it.
What Does Generating a Full Mockup Set Cost?
| Mockup set | GPT-image-2 (edit, 1K) | Nano Banana Pro (reference-guided, 1K) | Nano Banana 2 (bulk, 1K) |
|---|---|---|---|
| 6 App Store screenshots | $0.084 | $0.180 | $0.120 |
| 15-image packaging/pitch-deck set | $0.21 | $0.45 | $0.30 |
| 40-image product catalog mockup set | $0.56 | $1.20 | $0.80 |
At 4K for print-quality packaging renders, Nano Banana Pro runs $0.042/image and Nano Banana 2 runs $0.036/image — a 15-image print set still comes in under $0.65. The cost is low enough that the practical bottleneck is prompt iteration to land on a scene composition worth standardizing, not the generation spend itself.
FAQ
Can I generate a mockup for a product I haven't photographed yet?
You need at least a flat image of the product (a screenshot, a logo, or a rendered label) as the reference. The model composes the surrounding scene, but it isn't inventing the product design itself from a text description alone with the same fidelity as working from a real reference.
Does this work for packaging mockups with small print or fine text?
Legibility of small text depends on the model and resolution — generate at the highest resolution tier available (4K on Nano Banana Pro or Nano Banana 2) and verify text rendering before using the output in a client-facing pitch deck, since fine print is the first thing to degrade at lower resolutions.
Can I generate mockups at print resolution?
Yes — Nano Banana Pro and Nano Banana 2 both support 4K output ($0.042 and $0.036 per image respectively), which is sufficient for most print and pitch-deck use cases.
What's the difference between using GPT-image-2 edits versus Nano Banana Pro reference-guided generation for mockups?
GPT-image-2 edits modify an existing image in place via instructions (good for template-based work); Nano Banana Pro reference-guided generation builds a new scene around a reference image (good when you need a scene that doesn't exist yet, like a hand holding a device).
Is there a free tier to test mockup generation before committing to a full asset set?
Yes. GenRelay includes free credits on signup, enough to test both reference-guided generation and instruction-based editing across a handful of mockups before deciding on a workflow for a full set.
As of September 2026. Pricing subject to change — verify current rates at genrelay.ai.