Blog

Guide

Flux-2 Text-to-Image for E-commerce Product Images: Prompt Recipes and a Working HiAPI Request

Prompt templates for angle, lighting, and fine detail, plus a copy-paste HiAPI request and batch pattern

Nov 12, 2026 12 min read
Cover image: on a beige background, multiple layers of thin paper sheets recede in staggered succession, with graphite-grey edges, one of the sheets in terracotta orange.
On this page

Why flux-2/text-to-image fits e-commerce catalogs

Catalog image production has a cost curve problem: each SKU needs multiple angles, consistent lighting, and a clean background, and the marginal cost of "one more variant" is high whether you shoot it or edit it. Text-to-image changes that math when you have a solid product description and a repeatable prompt.

Where text-to-image wins

  • Long-tail and variant SKUs. Colors, sizes, and configurations that don't justify a photo shoot can still get a catalog-ready frame.
  • Concept and placeholder art. Category pages, A/B tests, and pre-launch listings need something plausible before the physical sample arrives.
  • Style exploration. You can test background and lighting directions quickly, then commit to a look before booking production.

Where it does not replace photography

If the buyer's decision depends on the exact physical item — stitching, wear, certification labels, precise color under real light — a generated frame is a concept, not evidence. Treat flux-2/text-to-image output as a catalog asset only when the image is representative of the product you ship, and keep real photography for hero shots where accuracy is the selling point.

Compared with image-to-image, text-to-image asks more of your prompt: there is no reference frame holding the composition in place. That is the trade-off. You get full control over angle, lighting, and background, and in exchange you must describe them explicitly. The rest of this guide is about making that description repeatable.

Photography, image-to-image, and text-to-image as three routes to the same catalog frame — the direct text-to-image path gets there in the fewest layers.

The base prompt structure that holds up across SKUs

A prompt that works for one product but breaks on the next usually fails because it mixes product-specific facts with scene decisions. Split them.

The six-slot skeleton

[SUBJECT] — [ANGLE] — [LIGHTING] — [BACKGROUND] — [DETAIL] — [STYLE/CONSTRAINTS]
  • Subject: what the object is, its material, color, and any defining shape. Keep it factual.
  • Angle: camera position relative to the product (front three-quarter, top-down, eye level).
  • Lighting: softbox key, rim light, shadow softness, direction.
  • Background: surface, color, and whether it is in focus.
  • Detail: the two or three features a buyer would inspect.
  • Style/constraints: commercial product photography, sharp focus, no text, centered framing.

A filled example

A matte ceramic coffee mug in deep forest green, front three-quarter angle
at eye level, soft diffused key light from the upper left with a subtle
rim light on the right edge, seamless light-gray background, visible
matte glaze texture and a clean handle curve, commercial product
photography, sharp focus, no text, no logos, centered composition

Keep slots stable, swap facts

Store the skeleton once in your generation script and inject only the subject and detail slots per SKU. Angle, lighting, background, and style stay fixed across a batch — that is what makes a grid of images look like one catalog instead of a collage. When you need a second view (top-down, side), change exactly one slot so you can attribute any visual difference to that change.

A practical habit: keep the slot order identical in every prompt you write. Models follow structure, and so do the humans reviewing your prompt library six months later.

Prompt recipes for camera angle and lighting

These templates are written to be pasted after your [SUBJECT] slot. Replace the background color to match your brand surface.

Angle recipes

Front three-quarter (default hero angle)

front three-quarter view, camera at product mid-height, product centered,
full product visible with small margin on all sides

Eye level / straight on

straight-on eye-level view, camera parallel to the product face,
no perspective distortion, product centered

Top-down flat lay

top-down overhead view, camera perpendicular to the surface,
product centered with even margin, flat shadow beneath

Slight high angle (good for boxed goods)

view from 30 degrees above the product, front face and top surface both
visible, camera angled toward the product center

Lighting recipes

Soft studio (safe default)

large softbox key light from the upper left, white fill reflector on the
right, soft contact shadow under the product, no harsh highlights

Side light for texture

grazing side light from the left to reveal surface texture, gentle fill
from the front, shadow falling to the right, background evenly lit

Clean catalog white

bright even lighting from two soft sources at 45 degrees, minimal shadow,
seamless white background, product edges cleanly separated

Moody accent (lifestyle-adjacent)

single directional key light from the upper right, deep falloff into a dark
gray background, soft highlight along one edge, controlled shadow

Framing notes that travel well

  • State the camera height when perspective matters; "mid-height" and "overhead" produce visibly different silhouettes.
  • Say where the shadow falls. Unspecified shadows are the most common source of batch inconsistency.
  • Fix the margin language ("small margin on all sides") so products don't get cropped differently across a run.

Combine one angle recipe with one lighting recipe and you have a stable matrix: four angles times four lighting setups gives sixteen looks from a single skeleton.

Three paper-layer stages show overhead light, side light and softbox fill — the geometry behind each prompt template.

Wording for prompt adherence and high-fidelity detail

Adherence problems usually come from vague nouns, not from too few adjectives. Stacking "beautiful, premium, stunning" adds style noise without telling the model what to render.

Name materials precisely

Replace "nice fabric" with the actual surface: brushed aluminum, matte powder-coated steel, pebbled leather, frosted glass, unbleached cotton canvas. Material words carry texture and reflectance, so they do more work than any style adjective.

Constrain the things you care about

Models follow explicit limits better than implicit wishes. Write the constraint as a statement about the image:

product occupies roughly 70 percent of the frame width
logo area left blank and unmarked
label text rendered as blank space, no lettering
only one product in frame, no props

Each line removes a degree of freedom. Keep constraints short and literal — a long paragraph of prohibitions tends to blur together.

Point at details instead of praising them

  • Weak: incredibly detailed and high quality
  • Strong: stitched seam visible along the top edge, subtle grain on the leather surface, metal clasp with a brushed finish

High-fidelity detail comes from naming the two or three features a buyer would zoom into, then letting the renderer handle the rest. If a detail matters, describe its position and material, not its importance.

Control drift by controlling scene words

Style words are not free. dramatic, cinematic, and luxury all bend lighting and contrast. If your catalog is clean and neutral, either drop them or pair them with an explicit correction like clean commercial lighting, no dramatic shadows. Adherence improves when every stylistic instruction has a matching physical description.

One more habit worth adopting: keep a written note of which constraint lines you added per product category. When an output drifts, you can diff the prompt instead of guessing.

A negative list that prevents common product-shot failures

Negative prompts are a scalpel, not a bucket. A short list aimed at failure modes you actually observe beats a wall of generic exclusions that can suppress useful rendering.

A compact starting list

text, watermark, logo, extra limbs, duplicate product, cluttered background,
harsh specular blowout, motion blur, distorted geometry, cropped product edges

Why each entry earns its place

  • text, watermark, logo — generated lettering is rarely usable and often garbled; blank is better than wrong.
  • duplicate product — multi-object scenes creep in when the background slot is vague.
  • cluttered background — protects the clean catalog look.
  • harsh specular blowout — glossy products lose surface detail to clipped highlights.
  • distorted geometry — handles, spouts, and rims bend when the angle slot is underspecified.
  • cropped product edges — pairs with your margin language to keep the full silhouette in frame.

Make it category-aware

Add, don't multiply. Glassware benefits from double reflections, opaque glass. Apparel benefits from mannequin, human model, folded garment. Food-adjacent products benefit from condensation, garnish, props. Remove entries once a category consistently behaves; a shorter negative list keeps the positive prompt in control.

The rule of thumb

If you cannot name the failure you saw in a specific output, do not add it to the negative list. Grow the list from reviews, not from anticipation.

A working hiapi request for flux-2/text-to-image

The request below sends one prompt to flux-2/text-to-image through the HiAPI unified interface. Swap the prompt string and you have your first product image.

The request

curl -X POST "https://api.hiapi.ai/v1/images/generations" \
  -H "Authorization: Bearer $HIAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-2/text-to-image",
    "prompt": "A matte ceramic coffee mug in deep forest green, front three-quarter view, camera at product mid-height, product centered with small margin on all sides, large softbox key light from the upper left, white fill reflector on the right, soft contact shadow under the product, seamless light-gray background, visible matte glaze texture and a clean handle curve, commercial product photography, sharp focus, no text, no logos",
    "negative_prompt": "text, watermark, logo, duplicate product, cluttered background, harsh specular blowout, distorted geometry, cropped product edges",
    "aspect_ratio": "1:1",
    "n": 1
  }'

Field by field

  • model — keeps the call routed to flux-2 text-to-image. Pin it explicitly so a future default change doesn't silently alter your catalog look.
  • prompt — the six-slot skeleton from earlier, assembled with one angle and one lighting recipe.
  • negative_prompt — the compact exclusion list; trim per category as you review outputs.
  • aspect_ratio — fix this per channel (square for grid tiles, portrait for mobile listing cards) so a batch stays uniform.
  • n — keep at one while you are refining the prompt, then raise it when you want variants to choose from.

Reading the response

The API returns a JSON object containing the generated image data plus metadata about the request. Parse the image payload, write it to storage under a key that includes the SKU and the angle/lighting pair (for example mug-green__front34__soft-studio), and log the exact prompt next to the file. That filename-plus-prompt pairing is what makes later QA and regeneration tractable. Billing follows the platform's standard image-generation meter, so check the pricing panel in your account for current rates rather than hardcoding assumptions into your script.

Batching prompts across a SKU list

Once a single request works, batching is template injection plus a loop. Keep the skeleton in code, keep the product facts in data.

The pattern

ANGLES = {
    "front34": "front three-quarter view, camera at product mid-height, product centered with small margin on all sides",
    "flat": "top-down overhead view, camera perpendicular to the surface, product centered with even margin, flat shadow beneath",
}
LIGHTING = "large softbox key light from the upper left, white fill reflector on the right, soft contact shadow under the product"
STYLE = "commercial product photography, sharp focus, no text, no logos, centered composition"

def build_prompt(sku, angle_key):
    return f"{sku['subject']}, {ANGLES[angle_key]}, {LIGHTING}, {sku['background']}, {sku['detail']}, {STYLE}"

For each SKU, iterate over the angle keys you need, build the prompt, call the API, and store the result under a deterministic filename. Sleep briefly between calls and retry transient failures with backoff; catalog runs are not latency-sensitive, so stability beats speed.

What to check before scaling volume

  • Prompt assembly is deterministic. The same SKU and angle must always produce the same prompt string. Log a hash of each prompt if you need proof.
  • Fixed slot values are truly fixed. Background, lighting, and style should come from constants, not from per-item data that drifted in.
  • Aspect ratio is set per channel, not per call site. One place in config, not scattered through the loop.
  • Storage keys carry angle and lighting. You will regenerate individual cells later; make them addressable.
  • A small pilot runs first. Ten SKUs across all angles, reviewed before the full list goes through.

Cost and time expectations

Generation time scales with the number of images, not the number of prompts, so budget one call per image and plan the run around that. Keep n at one during batch runs and generate variants only for SKUs that fail review — the same prompt with a higher n is cheaper to reason about than a second angle you never needed.

Reviewing outputs before they reach the catalog

A generated image that looks good but misrepresents the product is worse than no image. Run a short, consistent QA pass on every output before it is published.

The checklist

  • Angle matches the label. The file named front34 must actually be a front three-quarter view. Mismatched angles break grid consistency even when each image looks fine.
  • Full product in frame. No clipped edges, no product touching the frame boundary.
  • Text-free. Any lettering, watermark, or logo artifact means regenerate or fall back.
  • Brand fit. Background color, shadow softness, and contrast should sit alongside your existing catalog, not beside it.
  • Representative. The product shown must match what ships: correct color, correct material, correct proportions.

Regenerate versus fall back

Regenerate when the failure is cosmetic and prompt-fixable: wrong shadow direction, background drift, a stray prop. Tighten the offending slot and rerun. Fall back to photography, image-to-image, or a placeholder when the failure is factual — the model invented a feature, the material reads as the wrong finish, or the product shape is not faithful. No prompt edit reliably fixes a mismatch with the physical item.

Keep the review cheap

Review in contact sheets of one SKU across all angles, not one image at a time. Differences that are invisible in isolation — a shadow flip, a background shift — become obvious side by side. Record every rejection with its prompt hash so repeat offenders surface as prompt problems rather than one-off noise. Do this for one batch and you will find that most failures cluster in a handful of recurring slot values, which are exactly the ones worth fixing once.

Related articles

View all articles →

Start building with persistent AI artifacts

Get your API key and call image, video and audio models through one task-based API.

Read the API docs