Guide
Using gpt-image-2.5-sunburst/text-to-image for E-commerce Product Images via the HiAPI API
Reference-image workflow, prompt templates, and a working API request for product photography
On this page
Why text-to-image for e-commerce product imagery
Every catalog image has a job: show the product accurately, look like it belongs on your site, and cost less to produce than the revenue it supports. Text-to-image models like gpt-image-2.5-sunburst/text-to-image are useful for a specific slice of that job—not all of it.
Generated images work well when the product’s identity matters less than the scene around it: category banners, collection headers, mood-driven lifestyle shots, seasonal variants of a hero image, and placeholder art for SKUs that have no photography yet. They also help when you need many visual variants fast—different backgrounds, different color moods, different aspect ratios for different placements—without booking a studio each time.
Real photography still wins when exact fidelity is non-negotiable: color-accurate apparel, packaging with legible legal copy, jewelry and materials where buyers expect a true-to-life rendering, and any regulated category where the image must match a physical item precisely. A reasonable rule: generate the context, photograph the product. If a customer could reasonably complain that the image “isn’t the thing I received,” that image should start from a real photo.
The practical middle path is a reference-image workflow: you supply a real product shot, and the model composes new scenes around it. That keeps the product anchored while the scene stays flexible. The rest of this guide is about building that workflow on HiAPI’s unified API.

How gpt-image-2.5-sunburst/text-to-image fits your pipeline
Think of the model as one stage in a catalog pipeline, not a replacement for the pipeline. A typical flow looks like this:
- Asset input — you start with either a text description of the product or a reference image of the real item.
- Prompt assembly — a template merges the product facts (name, material, color, key features) with the scene you want (studio, lifestyle, flat-lay).
- Generation request — a single call to the HiAPI text-to-image endpoint produces one or more candidate images.
- Automated checks — resolution, aspect ratio, and basic sanity checks run before anything reaches a human.
- Human review — an editor signs off on fidelity and brand fit.
- Publish — approved assets are written to your CDN with metadata (SKU, prompt version, model, date).
HiAPI’s role in this diagram is to keep steps 3 through 5 uniform: one endpoint, one auth scheme, one response shape across the image models you use. You don’t build per-model integrations; you build one pipeline and swap the model name. The model page for gpt-image-2.5-sunburst/text-to-image is the source of truth for supported parameters and request shape—treat it as the contract your pipeline codes against.
Two design consequences follow. First, keep prompt generation in code, not in a spreadsheet, so every image is reproducible from a stored prompt plus a stored model version. Second, decide early whether a given catalog uses text-only prompts or reference images—the two paths have different QA needs.
Structuring prompts that keep products recognizable
The most common failure in generated product imagery is drift: the model invents details, changes materials, or slowly mutates the product across a batch. A prompt structure that separates concerns reduces drift and makes prompts debuggable.
Use four layers, in this order:
Subject. State the product plainly and completely: what it is, its material, its color, its shape, and any fixed branding. Keep this layer factual and identical across every variant of the same SKU. If the product is “a matte black ceramic coffee mug with a squared handle,” write exactly that—not “a stylish mug.”
Scene. Describe only the environment: surface, background, props, and whether the product sits alone or in use. This is the layer you vary between images. “On a light oak table against a warm off-white wall” is a scene; “beautiful” is not.
Lighting and camera. Specify light direction and quality, plus framing: “soft window light from the left, gentle shadow, three-quarter front view, shallow depth of field, product centered.” Camera language gives you predictable composition across a set.
Output constraints. State what must not change and what the final image needs to be: “product proportions unchanged, no added text on the product, clean background, square composition suitable for a grid tile.” Negative constraints belong here.
Keep the subject layer verbatim between variants and change only one other layer at a time. That way, when an image goes wrong, you know which layer caused it. Avoid stacking subjective adjectives—each one is another variable the model can interpret differently on the next run.

Using reference images for product consistency
When the product itself must stay recognizable, text alone is fragile. A reference image anchors shape, proportion, and branding in a way no adjective can. The workflow: take one clean, well-lit photo of the real product against a simple background, use it as the reference for every generated scene, and vary only the scene and lighting layers of the prompt.
Plan a consistency pass across the catalog before you generate at volume. Pick a handful of representative SKUs, generate three or four scene variants each from the same reference, and compare them side by side. Look for drift in the product’s silhouette, logo placement, and material finish. If the reference is doing its job, the product should look like the same object in every frame; if it isn’t, simplify the scene and tighten the constraints before scaling.
Two practical rules help. First, use the highest-quality reference you have—soft focus or busy backgrounds in the reference tend to leak into the output. Second, record which reference image each output used. When a product gets re-photographed, you’ll want to know exactly which generated assets to regenerate.

A working HiAPI request
The request below is the pattern to adapt; confirm exact parameter names and accepted values against the model page before you ship.
curl -X POST "https://api.hiapi.ai/v1/images/generations" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.5-sunburst/text-to-image",
"prompt": "A matte black ceramic coffee mug with a squared handle, on a light oak table against a warm off-white wall, soft window light from the left, gentle shadow, three-quarter front view, shallow depth of field, product centered, product proportions unchanged, no added text on the product, clean background, square composition",
"size": "1024x1024",
"n": 2
}'
Parameter by parameter:
- model — the model identifier. Pin it in config rather than hardcoding it in application code, so you can move models without a deploy.
- prompt — the fully assembled four-layer prompt. Build it in code from templates and product records.
- size — output dimensions. Match your placement: square for grid tiles, portrait for product pages, landscape for banners. Choose one size per variant batch so assets are interchangeable.
- n — how many candidates per call. Generating two or three and selecting the best is cheaper than regenerating after a failed review.
Send one request first and inspect the response shape before writing the batch loop. Log the request ID alongside the prompt and model version—it’s your handle for support and for reproducing an image later.
Reusable prompt templates for common product shots
Templates keep prompts consistent across hundreds of SKUs. Three patterns cover most catalog needs; each keeps the subject layer as a variable.
Studio template. {subject} on a seamless {background_color} background, even softbox lighting from front-left and front-right, subtle contact shadow beneath the product, straight-on centered view, sharp focus, no props, no text overlays, {aspect} composition. Use for category tiles and comparison grids where consistency matters most.
Lifestyle template. {subject}, in use on a {surface} in a {room_type} with {light_quality} light, {camera_angle} view, natural depth of field, realistic ambient shadow, no visible branding other than the product itself, {aspect} composition. Use for hero images and campaign placements. Keep the room description short—every added prop is a new variable.
Flat-lay template. {subject} arranged on a {surface} surface, shot from directly above, soft diffused daylight, minimal complementary props ({prop_list}), generous negative space at the top for copy, matte finish, no glare, no text overlays, {aspect} composition. Use for email headers and social placements where type will sit over the image.
In all three, {subject} should be the same string you use everywhere else for that SKU, and {aspect} should be driven by the target placement, not chosen per image. Version your templates—a one-line change to “lighting” can shift an entire catalog.
Reviewing generated images before they go live
Nothing generated should reach a product page without a check. Run automated checks first, then a human pass.
Automated: verify dimensions and aspect ratio match the placement, confirm the file isn’t blank or corrupted, and reject any image where automated detection flags text rendered onto the product or obvious repetition artifacts. Store the prompt version with the asset so a rejection can be traced to a template change.
Human review, in order of importance: product fidelity (does it look like the actual item—shape, color, material, logo placement), artifact scan (extra handles, warped edges, melted reflections, duplicated shadows), scene plausibility (does the shadow direction match the light source, do props make sense at this scale), and brand safety (no invented text on packaging, no misleading claims in the image, nothing that implies a false product feature). For regulated categories, add a category-specific checklist.
Keep rejected images and their prompts. A rejection log is the fastest way to find which template or reference is causing repeat failures.
Scaling generation across a catalog
At catalog scale, the pipeline matters more than any single image.
Batch by template, not by SKU. Group products that share a template and aspect ratio so you can generate, review, and publish in coherent runs. Process in small batches and check the first few outputs before committing the rest—drift found early is cheap.
Version everything. Prompts, templates, reference images, model identifier, and generation parameters all get versions. An asset record should be enough to regenerate that image months later, byte-for-byte where the model allows. Without this, a template tweak becomes an unrecoverable break.
Control cost by design. Image generation is billed by generated image, so the biggest savings come from fewer wasted calls: generate two or three candidates instead of ten, review in batches, and cache approved assets at the CDN rather than regenerating on page load. Track candidate-to-approved ratio per template—a template with a low ratio is a prompt problem, not a volume problem.
Fail gracefully. Wrap requests with retries and backoff, queue jobs rather than firing thousands at once, and isolate failures so one bad SKU doesn’t stall a batch.
Start with one template, one product family, and the request pattern above; expand once your approval ratio is predictable. The model page for gpt-image-2.5-sunburst/text-to-image has the current parameter details you’ll need as you build.
Related articles
View all articles →-
Guide
Veo 3.1 Image-to-Video Prompt Recipes: Copy-Paste Templates for Developers
First-frame descriptions, cinematic camera and lighting phrasing, native audio cues, and negative prompts you can reuse
9 min read -
Guide
P-Video-2-Pro Avatar Prompt Recipes: Copy-Paste Prompts for Talking-Head Videos
A practical prompt cookbook for avatar clips: spoken lines, emotion tags, shot framing, gestures, lip-sync pitfalls, and a negative checklist
10 min read -
Guide
How to Make Short-Form Video with ltx-2.5-fast/image-to-video on the HiAPI API
First/last-frame control, native audio, and a working request pattern for developers
9 min read