Guide
muse-image-1.0/text-to-image for E-commerce Product Images: A Developer Workflow Guide
Prompt templates for angles and lighting, size selection, and batch requests through the HiAPI API
On this page
Why text-to-image fits e-commerce product workloads
Catalog work is repetitive by nature: the same product, photographed from a handful of angles, lit the same way, on the same backdrop, at several sizes. That repetition is exactly what a text-to-image model handles well — not as a replacement for studio photography of hero products, but as a way to fill the long tail of a catalog cheaply and consistently.
Where generation earns its place:
- Variants at volume. Colorways, minor SKU differences, and packaging revisions where a fresh shoot costs more than the image is worth.
- Placeholder and pre-launch assets. Listing pages, internal review decks, and A/B tests that need something realistic before final photography lands.
- Composition exploration. Trying a top-down flat lay against a 45-degree hero shot before committing a photographer and a studio day.
Where it does not: regulated claims, packaging text that must be legible and exact, and hero imagery where customers compare fine material texture. Those still need a camera and a human.
The mental model for a developer is a pipeline. A structured product description goes in, a prompt template is rendered, the model returns one or more images, and a QA gate decides what reaches the storefront. Every section below is about making that pipeline boring and repeatable rather than clever.

Calling muse-image-1.0/text-to-image through HiAPI
All requests go through the same HiAPI interface, so you authenticate once and keep one client for every model you call. The model identifier is muse-image-1.0/text-to-image; your request carries the prompt, an output size selection, and any per-generation options you want to pin.
At the shape level, a single generation is: build the request payload, POST it through the HiAPI client, read back the result object, and persist the image reference alongside the product ID it belongs to. Two habits worth adopting from the first call:
- Keep the prompt in a variable, not inline in the request. You will reuse and diff it hundreds of times.
- Log the exact rendered prompt with every output. When an image looks wrong three weeks later, the prompt is the only debugging artifact you have.
import os
from hiapi import HiAPI
client = HiAPI(api_key=os.environ["HIAPI_API_KEY"])
prompt = render_product_prompt(product, angle="three-quarter", light="softbox-left")
result = client.images.generate(
model="muse-image-1.0/text-to-image",
prompt=prompt,
size="1024x1024",
)
save_asset(product_id=product.id, angle="three-quarter", result=result)
Treat size as part of the template, not an afterthought — the same prompt at a different aspect ratio can reframe the subject. The next sections cover both the prompt structure and the size decision.

Prompt templates for consistent camera angles
Consistency across a catalog comes from a fixed prompt skeleton with a small number of swapped slots. If every prompt is written fresh, every image drifts. Build one template per shot type and keep the camera language byte-identical across products.
A workable skeleton:
{subject_block}. {camera_block}. {light_block}. {background_block}. {style_block}
Only subject_block changes per product. camera_block is a constant per angle:
- Hero / three-quarter:
product photographed at a 45-degree three-quarter view, slightly above eye level, full product in frame with even margins - Front elevation:
straight-on front view, camera at product mid-height, centered, no perspective tilt - Top-down flat lay:
directly overhead top-down view, product centered, flat lay composition - Detail crop:
close-up macro view of the product surface, shallow depth of field
Two rules make these work in practice:
- State the viewpoint twice. An explicit angle plus a framing clause ("full product in frame with even margins") is more reliable than either alone.
- Avoid relative references. "Same angle as the last image" means nothing to a text-to-image model; every prompt must stand alone.
Store the templates in version control next to the rendering code. When you change a camera_block, bump a version number and regenerate a small sample before committing — a wording change is a catalog-wide change.
Prompt templates for lighting and background
Lighting and background are what make a generated set look like one shoot rather than a stack of unrelated images. Both belong in the constant part of your template, with explicit direction and softness.
Lighting language that transfers reliably:
- Direction:
key light from camera left,light from upper right,soft overhead light. Direction is the single most visible consistency lever — lock it per shot type. - Quality:
soft diffused light,large softbox, gentle shadows,hard directional light with defined shadow edge. - Fill and spill:
subtle fill from the right, low-contrast shadows,clean highlight on the top surface.
Background language:
- Seamless studio:
on a seamless light grey studio backdrop, no horizon line, soft contact shadow beneath the product. - Lifestyle surface:
resting on a matte stone surface, softly out-of-focus neutral background. - Cutout-friendly:
isolated on a plain white background, product fully in frame, generous margins for cropping.
Two practical cautions. First, the more surface and reflection a product has, the more precisely you must describe the lighting, because the highlight placement is the product's appearance. Second, do not mix backgrounds within one shot type — a grid tile set should share a backdrop, or the grid will look assembled from three different vendors. Pin these blocks as constants and change them only deliberately.
Choosing output size and aspect ratio
Decide size per placement before you batch, because a re-run with different dimensions is a full regeneration, not a resize. Map placements to aspect ratios first, then to pixel dimensions your front end actually renders.
- Grid and category tiles: square. Product grids crop unpredictably, so a square framing with generous margins survives most tile layouts.
- Product detail pages: square or 4:3, sized for the zoom viewer rather than the thumbnail. If the PDP crops to a fixed ratio, match it exactly and stop fighting it in CSS.
- Banners and hero strips: wide, and plan the safe area explicitly. Ask for the product centered with negative space on both sides so marketing copy has somewhere to sit.
- Email and social: match the platform's native ratio; regenerating is cheaper than padding.
A few rules of thumb:
- Choose one canonical size per placement and reuse it. Mixed sizes in one tile grid produce visible quality differences.
- Do not upscale a generated image to fill a larger slot. Generate the larger size and downscale.
- Re-check framing after a ratio change. A 45-degree hero composed for square may lose the product's base in a wide crop; adjust the framing clause in the
camera_blockaccordingly. - Keep size in the job record. When reviewing outputs later, size is part of the context, not metadata noise.
Batching requests and handling per-item results
At catalog scale, the unit of work is a job, not a request: one product, one shot type, one size, one rendered prompt. Model jobs as data first and send them through a bounded queue, so a failure is a re-runnable row rather than a lost afternoon.
A robust loop does four things:
- Render prompts deterministically from the template plus product fields, and store the rendered string on the job.
- Bound concurrency to whatever your account and downstream storage tolerate; do not fire a whole catalog at once.
- Handle results per item. A batch succeeds or fails item by item, so write each result against its
job_idand never assume the whole batch is atomic. - Retry with backoff on transient errors only. Validation errors — malformed prompt, unsupported size — will fail identically on retry, so classify before retrying.
for job in queue.fetch_pending(limit=50):
try:
result = client.images.generate(
model="muse-image-1.0/text-to-image",
prompt=job.prompt,
size=job.size,
)
db.record_success(job.id, result)
except TransientError as e:
queue.requeue(job.id, backoff=e.retry_after)
except ValidationError as e:
db.record_failure(job.id, reason=str(e))
Keep a per-job status column (pending, done, failed) and a dead-letter view for failures. When a batch finishes, report counts by shot type and size, not one total — that is where regressions hide.
QA checklist before publishing generated images
Generated images need a gate, and the gate should be a checklist with a human behind it. Automated checks catch the cheap problems; a reviewer catches the expensive ones.
Automated before review:
- Correct aspect ratio and pixel dimensions for the target placement.
- No obviously corrupted output; file opens and decodes cleanly.
- The expected product colorway, where the prompt specified one.
- Required margins present for crop tolerance in grid tiles.
Human review before publishing:
- Does the product look like this product — shape, proportions, hardware, and finish?
- Any invented text, logos, or packaging copy? Generated lettering is a common failure and a legal liability on a storefront.
- Lighting and background match the rest of the set at tile scale, not just at full size.
- No stray objects, extra components, or implausible reflections in the frame.
- Claims and regulated labeling untouched by generation; those images should route to photography.
Record the reviewer and the prompt version with each approved asset. When a customer complaint or a takedown arrives, that trail is what lets you find every affected image at once — and regenerate or pull the whole set.
Start with one shot type, one size, and a small product sample through the HiAPI interface, and expand the template only after the outputs pass review.
Related articles
View all articles →-
Guide
gpt-6.2-sol Getting Started Guide: Capability Boundaries, API Integration, and Token Pricing Essentials
Integration decisions and practical essentials for engineering teams
-
Guide
gpt-6.2-astra Getting Started Guide: Text Model Capability Boundaries, Integration Essentials, and Cost Control
-
Guide
Tripo H3.1 Getting Started Guide: Choosing Among Three Input Modes, Parameters, and Pricing
A practical guide for developers on 3D generation integration decisions and cost control