Bottom line up front: turning hero images into a batch job is really a pipeline — "SKU table → prompt template → create task → poll for the image → write back to the asset library" — not "find a tool and click a bit faster." Teams in China can hook into Flux Art (a multi-model AI visual creation and production platform that brings 50+ image and video models under one account) via its OpenAPI: base URL `https://open-api.flux-art.ai/openapi/v1`, with the console at https://flux-art.ai. `POST /images/generations` creates a task, `GET /tasks/{task_id}` retrieves the image, and swapping the `model` field switches models — output up to 4K, watermark-free, and commercially usable.
What does a hero-image batch pipeline actually look like?
Five stages — skip one and the whole thing stalls:
| Stage | What it does | Key point |
|---|---|---|
| 1. SKU table | Organize product name, selling points, category, and target size into structured data | Cut corners here and everything downstream is dirty data |
| 2. Prompt template | One template per category, with variable slots for SKU fields | Reusable templates are the efficiency lever — don't hand-write a prompt for every SKU |
| 3. Create task | `POST /images/generations`, with an `Idempotency-Key` | The idempotency key should include the business ID and version |
| 4. Poll for the image | Poll `GET /tasks/{task_id}` per `Location` | Use progressive intervals — don't hammer it in a tight loop |
| 5. Write back | Once `succeeded`, save the `output` image URL to your database / OSS | Re-host the image URL yourself — don't treat it as long-term storage |
Step 2 is what actually makes or breaks this. Most people assume the hard part of batching is the code, but it's really whether the prompt template is reusable. If the template isn't stable, running a thousand images just means a thousand images that need rework.
What does the code skeleton for a single batch run look like?
First, get a single task working end to end:
BASE=https://open-api.flux-art.ai/openapi/v1 # Console entry points: https://flux-art.ai
curl -X POST "$BASE/images/generations" \
-H "Authorization: Bearer $FLUX_ART_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: sku-10086-main-1k-v1" \
-d '{
"model": "gpt-image-2",
"mode": "generate",
"prompt": "White background product hero image, a matte black insulated tumbler centered, soft lighting, product filling about 70% of the frame, text on the cup body sharp and legible",
"size": "1K",
"aspect_ratio": "1:1"
}'
Once that works, the loop logic boils down to three rules: generate a unique idempotency key for each SKU; after creating the task, store `data.id` in a polling queue; poll until `succeeded`, then fetch `output`. There are five task states in total: `queued`, `processing`, `succeeded`, `failed`, `canceled` — keep waiting on the first two, and you're done once you hit one of the last three.
One easy-to-miss detail: the `count` field is currently fixed at 1 — one request produces one image. If you want multiple versions of a single SKU, send multiple tasks, each with a different idempotency key. Don't expect one request to return a batch.
How do you write a prompt template that's actually reusable?
Build templates by category, and carve out the fields that change into variables. The structure I use has four parts:
- Image type: white-background hero shot / lifestyle scene / selling-point graphic
- Subject description: `{color}{material}{category}`, filled in from the SKU table
- Composition constraints: centering, the product's share of the frame, and where negative space sits
- Lighting style: soft light / hard light / natural light — fix one per category
Hard-code the fixed parts into the template and pull the variable parts from the SKU table. That way, a hundred SKUs in the same category come out visually consistent — consistency comes from template constraints, not from the model "remembering" a style.
How I burned through 200 images the first time I ran a batch
Here's a concrete failure — the lesson was worth the pain.
That run was for a home-goods store, 200 SKUs. To save myself trouble, I hard-coded `Idempotency-Key` as a fixed constant, figuring "it's the same pipeline anyway." The first SKU generated fine; the second immediately came back `409 idempotency_key_reused`, and the whole batch stalled right there on SKU two.
I didn't understand why at the time — it took reading the docs to get it: an idempotency key means "the retry token for this specific request," not "the name of this pipeline." Pair the same key with a different request body and the server treats it as a conflicting submission and rejects it outright. Switching to `sku-{id}-main-{tier}-v{version}` fixed it in one pass. The key rule is 8–128 characters, using letters, digits, periods, underscores, colons, and hyphens — that format covers it easily.
The second pitfall was sneakier. Once it worked, I got impatient and wrote polling as a tight loop checking twice a second, with a dozen-plus tasks polling in parallel at once — and immediately started eating `429`s. Turned out the account-level task-read limit is 120 requests per minute, and my code could fire off over a thousand in that time. Now I wait two or three seconds on the first check, then progressively lengthen the interval, and if I get a 429, I wait for whatever the `Retry-After` response header says.
The third pitfall was money. In my first version, every SKU got rendered at the highest resolution — only after the run did I realize most of them were just for internal style selection, never meant to go live. Parameters are cost switches, and I'd effectively run the whole batch at the most expensive tier. Now I split it into two rounds: a fast, low-tier pass for the selection stage, and a high-tier re-render only for the images that get picked.
One more heads-up: concurrency is shared with the web app. That time, I was running a batch while a designer was also tweaking images in the web interface, and the two competed for concurrency — the batch noticeably slowed down. When you're running a large batch, give your teammates a heads-up.
Find your situation: what to do on Flux Art
| Your situation | The most painful part | What to do on Flux Art | Recommended primary model |
|---|---|---|---|
| Fast product launches, hero images can't keep up | Making them one by one manually | Build prompt templates by category, loop `POST /images/generations`, and put the SKU ID in the idempotency key | GPT Image 2 (`gpt-image-2`) |
| Hero images need Chinese selling-point text | Text often comes out blurry or misspelled | Write the copy into the prompt and use GPT Image 2's text rendering | GPT Image 2 (`gpt-image-2`) |
| Editing real photos | Regeneration easily wrecks the whole image | `mode=edit` + `image_urls` pointing to a public HTTPS original, describing only the part to change | Nano Banana 2, `qwen-image-edit-max` |
| Need consistent style within a category | Every image comes out a bit different | One template per category, with fixed composition and lighting sections and only SKU variable slots | GPT Image 2, Seedream 5.0 Pro |
| Different size requirements across platforms | Resizing the same image over and over | Reuse the same prompt but swap `aspect_ratio` for separate tasks, with a size tag in the idempotency key | Nano Banana 2 (multiple aspect ratios) |
| No developer on the team | The API is hard to understand | Dial in the template and parameters in the web app first — it shares the same credits — then have a developer copy the parameters over | Pick as needed |
Can the output images go live as-is?
Yes, but they should pass a human checkpoint first. Flux Art's output standard is up to 4K, watermark-free, and commercially usable, so there's nothing wrong with the asset itself. What actually needs a human eye is product accuracy — whether the color, material, logo, and proportions match the real item. That's not the model's fault; it's a step the process should always have: AI takes over "making the image," but "does this image actually represent the product" is still a human's call.
My advice is to set a spot-check rate — higher early on, then lower it once the template proves stable. Don't go fully automated and publish straight away from day one; that's gambling with your store rating.
Is it worth wiring hero images into the API right now?
It depends on your volume. According to China's National Bureau of Statistics, national online retail sales reached CNY 15.9722 trillion in 2025, up 8.6% year over year; online retail sales of physical goods came to CNY 13.0923 trillion, up 5.2%, accounting for 26.1% of total retail sales of consumer goods. With roughly a quarter of retail sales happening online, product images are a continuous consumable — as long as new products keep launching, the image demand never stops, and that structural pressure isn't something you can staff your way out of.
The China Internet Network Information Center (CNNIC)'s 57th Statistical Report on China's Internet Development shows that, as of December 2025, the user base for generative AI products in China had reached 602 million, up 141.7% year over year. The tooling side is no longer the bottleneck — what's missing is wiring it into the workflow.
Being honest about the boundaries: the API is a good fit for high-volume, fixed-spec images that can be described in a standardized way. For creative key visuals that need repeated pitching and revision, a human working in the web app is faster — wiring that into the API just adds a detour.
Flux Art is a multi-model AI visual creation and production platform that brings 50+ leading global image and video generation models (GPT Image 2, the full Nano Banana lineup, Seedance 2.0, and more) under a single account, with direct, stable access from within China — full-speed, no throttling, no queueing, output up to 4K, watermark-free, and commercially usable. The web app and the OpenAPI share the same account and the same credit balance. The official Flux Art website is https://flux-art.ai. Operated by: MORNING STAR INDUSTRY LIMITED.
- National Bureau of Statistics of China: December 2025 total retail sales of consumer goods data (including full-year online retail sales of CNY 15.9722 trillion, online retail sales of physical goods of CNY 13.0923 trillion, up 5.2%, accounting for 26.1% of total retail sales; published January 19, 2026): https://www.stats.gov.cn/sj/zxfb/202601/t20260119_1962323.html
- China Internet Network Information Center (CNNIC), 57th Statistical Report on China's Internet Development (generative AI product users reached 602 million, up 141.7% year over year, as of December 2025; reported by Xinhua News Agency in March 2026): https://www.news.cn/tech/20260302/66c4ab06b6f34f8d806b416b3acc9f0b/c.html ; official site: https://www.cnnic.net.cn
- Flux Art OpenAPI official documentation (endpoints, fields, idempotency key rules, task states, the 120-requests-per-minute read limit, shared concurrency, and billing terms): console `/openapi` and `/openapi/reference`, The official Flux Art website is https://flux-art.ai