HiAPI
  • Models
  • Pricing
Search

Search HiAPI models, tools, and resources.

LoginGet Started
  • Models
  • Pricing
HiAPI

One API, All AI Models

Generate images, video, and audio with leading models through one production-ready API.

Get a free API key

AI Image API

  • All image models
  • GPT Image 2
  • Nano Banana 2
  • Seedream 5.0 Pro
  • Qwen Image 2.0 Pro
  • FLUX 1.1 Pro

AI Video API

  • All video models
  • Seedance 2.5
  • FLUX.3 Video
  • Seedance 2.0
  • Veo 3.1
  • Kling 3.0

AI Audio API

  • All audio models
  • MiniMax Music 2.6
  • MiniMax Music 1.5
  • ElevenLabs v3
  • Text to music
  • Text to speech

Product

  • Model marketplace
  • Playground
  • Pricing
  • Image API Cost Calculator
  • Free GPT Image 2 Generator
  • Free Nano Banana Image Generator
  • Outfit Preview
  • Product Photo Lab

Developers

  • Documentation
  • API Reference
  • Agent Skills
  • LLM integration index
  • Blog

Company

  • About
  • Contact support
  • Terms of Service
  • Privacy Policy

© 2026 hiapi. All rights reserved.

Open source on GitHubPython SDK on PyPI
  • TL;DR
  • Why flux-2 fits product photography
  • How to read these recipes
  • Recipe 1 — The clean packshot
  • Recipe 2 — Prompt adherence, tested
  • Recipe 3 — The lifestyle / in-context shot
  • Recipe 4 — The multi-angle PDP set
  • Running flux-2 on the task API
  • Generating a whole catalog in a batch
  • Takeaways
GuideJul 1, 20267 min read

flux-2 for E-Commerce Product Images: A hiapi API Recipe

Generate catalog-ready product shots with the flux-2/text-to-image API on hiapi — clean packshots, prompt-adherent constraints, and a batch loop for whole catalogs.

HiAPI Teamflux-2Image APIE-CommerceGuide

Latest models

Explore models

Contents
  • TL;DR
  • Why flux-2 fits product photography
  • How to read these recipes
  • Recipe 1 — The clean packshot
  • Recipe 2 — Prompt adherence, tested
  • Recipe 3 — The lifestyle / in-context shot
  • Recipe 4 — The multi-angle PDP set
  • Running flux-2 on the task API
  • Generating a whole catalog in a batch
  • Takeaways

Generate it with HiAPI

Choose a model, enter your prompt, and see the result.

HiAPI Blog

Related articles

HiAPI

Generate it with HiAPI

TL;DR

  • What this is: a working recipe for generating e-commerce product images with flux-2/text-to-image on hiapi. Every image on this page was produced by the exact prompt printed right above it — no borrowed demos — so you can reproduce each one.
  • Why flux-2 for products: it leans on prompt adherence and high fidelity, which is exactly what catalog work needs — an exact count of items, a specific colour, a clean seamless background, and blank (un-lettered) labels, all followed literally.
  • Model facts (verified on the API): flux-2 runs on the async task endpoint (/v1/tasks). input.resolution takes the megapixel form — 0.5 MP, 1 MP, 2 MP, or 4 MP — not 1K/2K. aspect_ratio is optional and accepts values like 1:1, 3:2, 16:9.
  • Pricing (per image): 0.5 MP is $0.0375, 1 MP is $0.05, 2 MP is $0.075, 4 MP is $0.125. See pricing for the live numbers.
  • How to run it: POST to the task API, poll until success, then download the image from output[0].url (that URL expires — save the bytes immediately). Full copy-paste script at the end, including a batch loop.

Why flux-2 fits product photography

Most text-to-image models can draw a nice-looking mug. The problem in e-commerce isn't "nice" — it's exact. A product listing needs the right colour, the right number of items, a clean background with room for your own overlay, and labels that stay blank so you can drop in real copy later. When a model improvises — adds a fourth bottle, invents label text, tints the white background — you can't ship the shot.

flux-2 is tagged for prompt adherence and high fidelity, and in practice that means it tends to do what the prompt literally says. That's the whole game for catalog imagery: you write the constraints, and the model honours them instead of "creatively interpreting" them. The recipes below are built around that — each one leans on a specific constraint (a count, a colour, a layout) so you can see the adherence for yourself.

Flat-lay of e-commerce product props generated with flux-2 on hiapi

How to read these recipes

Each recipe has three parts: a one-line goal, the exact prompt (copy it as-is), and the image it generated. I wrote every prompt myself and ran it through flux-2 on the live task API. A few habits that consistently help with this model:

  • State the background explicitly. "Seamless light-grey studio background" beats leaving it to chance, and it keeps the shot ready for a PDP.
  • Say "no text, no logo" when you want blank labels. flux-2 will honour it, which means you can add real branding downstream.
  • Give it countable, checkable constraints. "Exactly three bottles", "left amber, middle clear, right teal" — concrete instructions are where adherence pays off.
  • Reserve negative space in the prompt ("generous empty space at top for a headline") when the image is going under overlaid copy.

Recipe 1 — The clean packshot

Goal: the bread-and-butter listing shot — one product, seamless background, even margins, ready to drop onto a product page.

A single matte-white ceramic coffee mug centered on a seamless light-grey studio background, three-quarter front angle, empty and unbranded. Soft even top-light with one subtle rim highlight down the left edge, a soft grounded contact shadow beneath. Studio e-commerce packshot, perfectly centered, wide even margins on all sides, photoreal, high detail, no text, no logo.

Single white ceramic mug packshot on a seamless grey background

The margins and centering come straight from the prompt — asking for them explicitly is what keeps the crop usable across a grid of listings.

Recipe 2 — Prompt adherence, tested

Goal: prove the model follows exact, countable instructions — the reason to reach for flux-2 on product work in the first place.

Product photo of exactly three glass spray bottles standing in a row on a white acrylic surface: the left bottle filled with pale amber liquid, the middle bottle filled with clear liquid, the right bottle filled with soft teal liquid. All three have matte-black fine-mist pump tops and blank labels with no writing. Even frontal studio light, soft reflections on the acrylic, seamless white background. Photoreal commercial product photography, sharp focus, no text anywhere in the image.

Three spray bottles — amber, clear, teal — with blank labels, generated by flux-2

Count it: three bottles, not four. Left-to-right the fills are amber, clear, teal — in order. The pump tops are matte black. The labels are blank, so real copy can go on later. That's the payoff — you specify, it complies, and the shot is usable as-is.

Recipe 3 — The lifestyle / in-context shot

Goal: stage the product in a scene without burying it — the "in use" image that sits alongside packshots on a listing.

Lifestyle e-commerce shot of a tan leather crossbody bag resting on a pale oak cafe table beside a folded newspaper and a cup of espresso, soft morning window light from the left, warm out-of-focus cafe interior in the background with creamy bokeh. The bag is the clear hero, sharp and well-lit, staged naturally but uncluttered. Photoreal, editorial product-in-use photography, warm neutral palette, shallow depth of field, no visible brand marks or text.

Tan leather bag staged on a cafe table with soft bokeh background

Naming the hero ("the bag is the clear hero, sharp") and pushing everything else into bokeh keeps the product legible while still telling a story — the balance a lifestyle shot needs.

Recipe 4 — The multi-angle PDP set

Goal: the angle set a product-detail page uses — several consistent views of one item, matched in lighting and scale.

A clean product-detail-page angle set of one pair of low-top canvas sneakers in off-white, shown as three separate views arranged left to right on a seamless light-grey background: a straight side profile, a three-quarter front angle, and a top-down overhead view. Consistent soft studio lighting and identical scale across all three, even spacing, soft contact shadows. Catalog-grade e-commerce photography, photoreal, crisp, unbranded, no text or labels.

Three consistent angles of off-white sneakers for a product detail page

Asking for "consistent lighting and identical scale across all three" is what makes the set feel like one product instead of three loose renders. It won't replace a real 360 rig, but it's a fast way to mock up a PDP layout before shooting.

Running flux-2 on the task API

flux-2 uses hiapi's async task protocol — you create a task, poll it, then download the result. The one thing to get right: resolution is the megapixel form. Send "1 MP", not "1K", or the API returns a 400 telling you the value must be one of 0.5 MP / 1 MP / 2 MP / 4 MP.

1. Create the task

curl -s https://api.hiapi.ai/v1/tasks \
  -H "Authorization: Bearer $HIAPI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-2/text-to-image",
    "input": {
      "prompt": "A single matte-white ceramic coffee mug centered on a seamless light-grey studio background, three-quarter front angle, soft even top-light, photoreal e-commerce packshot, no text, no logo",
      "aspect_ratio": "1:1",
      "resolution": "1 MP"
    }
  }'
# -> {"code":200,"data":{"taskId":"tk-hiapi-..."},"message":"success"}

2. Poll until it's done, then download

import os, time, requests

TOKEN = os.environ["HIAPI_TOKEN"]
BASE = "https://api.hiapi.ai/v1/tasks"
HEADERS = {"Authorization": f"Bearer {TOKEN}"}


def generate(prompt, aspect_ratio="1:1", resolution="1 MP"):
    # create
    r = requests.post(BASE, headers=HEADERS, json={
        "model": "flux-2/text-to-image",
        "input": {"prompt": prompt, "aspect_ratio": aspect_ratio, "resolution": resolution},
    }).json()
    task_id = r["data"]["taskId"]

    # poll (a single image usually lands well under two minutes)
    deadline = time.time() + 600
    while time.time() < deadline:
        task = requests.get(f"{BASE}/{task_id}", headers=HEADERS).json()["data"]
        if task["status"] == "success":
            # output[0].url is a temporary link — download the bytes now
            url = task["output"][0]["url"]
            return requests.get(url, timeout=120).content
        if task["status"] == "fail":
            raise RuntimeError(task.get("error"))
        time.sleep(5)
    raise TimeoutError(task_id)


img = generate("A single matte-white ceramic coffee mug on a seamless light-grey background, photoreal e-commerce packshot, no text")
open("mug.jpg", "wb").write(img)

The URL in output[0].url carries an expireAt timestamp — it's a short-lived link. Download the bytes and push them to your own storage right away; don't hotlink it into a live listing.

Generating a whole catalog in a batch

For a real store you're not making one image — you're making one per SKU. Keep a list of prompts, reuse the generate() function above, and save each result under its SKU:

catalog = {
    "SKU-1001": "A single matte-white ceramic coffee mug on a seamless light-grey studio background, three-quarter angle, soft even top-light, photoreal e-commerce packshot, no text, no logo",
    "SKU-1002": "A tan leather crossbody bag on a seamless light-grey studio background, front-on, soft studio light, grounded contact shadow, photoreal packshot, no visible brand marks",
    "SKU-1003": "A pair of off-white low-top canvas sneakers, side profile, seamless light-grey background, crisp catalog lighting, photoreal, unbranded, no text",
}

for sku, prompt in catalog.items():
    img = generate(prompt, aspect_ratio="1:1", resolution="1 MP")
    open(f"{sku}.jpg", "wb").write(img)
    print(f"{sku} done")

A couple of things worth knowing before you scale it up:

  • Resolution drives the bill. At 1 MP each image is $0.05; step up to 2 MP ($0.075) or 4 MP ($0.125) only for hero shots where the extra detail earns its keep. A 200-SKU catalog at 1 MP is about $10. Check pricing for the current figures before you budget.
  • Run tasks concurrently. Each SKU is an independent task — create several, then poll them in parallel rather than one-at-a-time, and a large batch finishes in a fraction of the wall-clock time.
  • Keep a consistent "house" clause. Notice the shared tail in every prompt above ("seamless light-grey studio background … photoreal packshot, no text"). Locking that phrasing is what makes a batch look like one catalog instead of a grab-bag.

Takeaways

  • flux-2's strength on product work is doing what you literally asked — exact counts, exact colours, blank labels — so write the constraints explicitly and let it comply.
  • Always state the background and reserve negative space in the prompt; it's what makes a render drop straight into a listing.
  • On the task API, send resolution in megapixels (1 MP), poll /v1/tasks/{id} to success, and download output[0].url before it expires.
  • Price scales with resolution — batch your catalog at 1 MP and reserve 2 MP/4 MP for hero shots.

Ready to try it? Grab a key, point model at flux-2/text-to-image, and check the live rates on the pricing page before you batch a catalog.

Latest models

View all models
  • GPT Image 2From $0.007/image
  • Nano Banana 2From $0.051/image
  • Seedream 5.0 ProFrom $0.050/image
  • Seedance 2.5From $0.121/s

Explore models

TextImageVideoAudio
Back to blog
GPT Image 2From $0.007/image
Nano Banana 2From $0.051/image
Seedream 5.0 ProFrom $0.050/image
Seedance 2.5From $0.121/s
View all models
TextChat and reasoning
ImageGenerate and edit
VideoText and image to video
AudioSpeech and music
Start generating
View model pricing
View all articles
Seedance 2.5 Text-to-Video: Build Short-Form Clips with the hiapi API

Seedance 2.5 Text-to-Video: Build Short-Form Clips with the hiapi API

Seedance 2.5 Reference-to-Video for Short-Form TikTok and Reels Clips

Seedance 2.5 Reference-to-Video for Short-Form TikTok and Reels Clips

Grok Imagine Image 2.0 Image-to-Image Prompts: 4 Recipes With Real Outputs

Grok Imagine Image 2.0 Image-to-Image Prompts: 4 Recipes With Real Outputs

Grok Imagine 2.0 Text-to-Image Prompt Recipes: Copy-Paste Prompts With Real Outputs

Grok Imagine 2.0 Text-to-Image Prompt Recipes: Copy-Paste Prompts With Real Outputs

Using flux-2-klein-9b/text-to-image for E-Commerce Product Images via the hiapi API

Using flux-2-klein-9b/text-to-image for E-Commerce Product Images via the hiapi API

Flux-2-Klein-9b Image-to-Image for E-Commerce Product Photos

Flux-2-Klein-9b Image-to-Image for E-Commerce Product Photos

Start generating