HiAPI
  • Models
  • Pricing
Search

Search HiAPI models, tools, and resources.

  • 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
  • Why image-to-image instead of a second photoshoot
  • The workflow: one base shot, three scene edits
  • Request shape and pricing
  • Code: submitting and polling a task
  • Batching across a full catalog
  • FAQ
  • Try it yourself
GuideAug 6, 20267 min read

Grok Imagine Quality Image-to-Image for E-Commerce Product Images

Turn one studio shot into a full product catalog with grok-imagine-quality/image-to-image on the hiapi API

hiapiGrok Imagine QualityImage Editing APIE-CommerceProduct Photography

Latest models

Explore models

Contents
  • Why image-to-image instead of a second photoshoot
  • The workflow: one base shot, three scene edits
  • Request shape and pricing
  • Code: submitting and polling a task
  • Batching across a full catalog
  • FAQ
  • Try it yourself

Generate it with HiAPI

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

HiAPI Blog

Related articles

HiAPI

Generate it with HiAPI

Reshooting a product for every new listing angle, seasonal banner, or marketplace template is slow and expensive. grok-imagine-quality/image-to-image solves a narrower, more useful problem: give it one clean reference photo and a text prompt, and it drops that exact product — same shape, same color, same proportions — into a new scene. One studio shot becomes a lifestyle photo, a flat lay, and an in-use shot without a second physical photoshoot.

This guide walks through a real e-commerce workflow on the hiapi API: generating a base product photo, running it through three scene transformations with grok-imagine-quality/image-to-image, and batching the same pattern across a full product catalog — with working code and current pricing.

Prerequisites:

  • A hiapi API key from your dashboard
  • Python 3.9+ with requests (or just curl)
  • Your base product image hosted at a public URL — the task API fetches image_urls by URL, not by upload

Why image-to-image instead of a second photoshoot

A text-to-image model can generate a nice-looking coffee dripper, but it can't generate your coffee dripper — the exact silhouette, glaze color, and spout angle a customer already recognizes from your listing photos. grok-imagine-quality/image-to-image takes that exact object as a reference and re-renders it into a new environment, which is the difference between "a product photo" and "our product's photo."

That makes it a fit for the recurring e-commerce need: one hero shot per SKU, then N variations (lifestyle context, flat lay, in-use, seasonal backdrop) for the product gallery, ads, and marketplace listings — without booking a studio each time.

The workflow: one base shot, three scene edits

The base photo here was generated with gpt-image-2/text-to-image ($0.03/image at 1K) — any clean, well-lit product photo works as the reference, including a real photograph if you already have one:

Ceramic pour-over coffee dripper on a plain white studio background

That single image URL then gets reused across three grok-imagine-quality/image-to-image calls, one per target scene:

The same coffee dripper on a rustic wooden kitchen counter with morning sunlight

The same coffee dripper flat-laid on white marble next to a folded linen napkin

The same coffee dripper in use, with hot water being poured in from a gooseneck kettle

Across all three, the dripper's proportions, glaze color, and handle shape stay identical — only the scene around it changes. That consistency is the entire value proposition of using i2i here instead of independent t2i generations per scene, which would give you three different-looking products.

Request shape and pricing

grok-imagine-quality/image-to-image takes a small, strict input schema — extra fields like strength or a seed are rejected:

FieldRequiredNotes
promptyesDescribe the new scene; explicitly instruct the model to preserve the reference's shape/color/proportions
image_urlsyes1–3 public URLs. With multiple references, the output frame follows the first URL
resolutionno1k or 2k (lowercase)
aspect_rationoauto (default, follows the input frame) or a fixed ratio like 16:9, 1:1, 9:16

Pricing as of 2026-08 (verified against hiapi's pricing page): $0.09/image at 1K, $0.11/image at 2K for grok-imagine-quality/image-to-image. The base studio shot on gpt-image-2/text-to-image runs $0.03 at 1K. A 4-image set like the one above — one base photo plus three scene edits — costs $0.30 total.

Code: submitting and polling a task

Every generation on hiapi goes through the same async task lifecycle — submit, poll GET /v1/tasks/{id} until status is success, then download output[0].url immediately (the URL expires). See the async task API reference for the full contract. Here's the i2i call specifically:

import requests
import time

API_BASE = "https://api.hiapi.ai/v1/tasks"
HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}

def edit_product_scene(base_image_url: str, prompt: str) -> str:
    payload = {
        "model": "grok-imagine-quality/image-to-image",
        "input": {
            "prompt": prompt,
            "image_urls": [base_image_url],
            "resolution": "1k",
        },
    }
    resp = requests.post(API_BASE, headers=HEADERS, json=payload, timeout=60)
    task_id = resp.json()["data"]["taskId"]

    while True:
        task = requests.get(f"{API_BASE}/{task_id}", headers=HEADERS, timeout=30).json()["data"]
        if task["status"] == "success":
            return task["output"][0]["url"]
        if task["status"] == "fail":
            raise RuntimeError(task.get("error"))
        time.sleep(5)

The prompt is where consistency actually comes from — there's no strength or reference-weight parameter, so the wording has to do the work:

Place this ceramic pour-over coffee dripper on a rustic wooden kitchen
countertop, warm morning sunlight streaming in from the left, a few
coffee beans scattered near the base, shallow depth of field, lifestyle
e-commerce photography, keep the dripper's shape, color and proportions
identical to the reference

That closing clause — "keep the shape, color and proportions identical to the reference" — made a measurable difference in testing. Drop it and the model treats the reference more loosely, redrawing proportions and blending in slightly generic details.

One caveat: don't expect literal pose control. Asking for "the same angle" on a scene swap isn't honored strictly — the object's orientation tends to re-settle naturally into whatever fits the new scene. If exact orientation matters, say so explicitly in the keep-clause (e.g., "keep the spout facing left").

Batching across a full catalog

The same call scales directly into a catalog job — loop over (SKU, base image, scene prompt) tuples instead of hardcoding one product:

CATALOG = [
    {"sku": "dripper-ceramic-01", "base_url": "https://cdn.example.com/dripper-01-base.jpg"},
    {"sku": "kettle-gooseneck-02", "base_url": "https://cdn.example.com/kettle-02-base.jpg"},
    # ...
]

SCENE_PROMPTS = {
    "lifestyle": "Place this product on a rustic wooden kitchen countertop, warm morning "
                 "sunlight, lifestyle e-commerce photography, keep shape, color and "
                 "proportions identical to the reference",
    "flatlay": "Place this product on a white marble countertop, top-down flat lay, soft "
               "diffused daylight, keep shape, color and proportions identical to the reference",
}

results = []
for item in CATALOG:
    for scene_name, prompt in SCENE_PROMPTS.items():
        url = edit_product_scene(item["base_url"], prompt)
        results.append({"sku": item["sku"], "scene": scene_name, "url": url})
        # download + upload to your own storage here — output URLs expire

There's no native idempotency_key field on the task API, so if a batch job needs to be safely re-run after a crash, dedupe on (sku, scene_name) in your own store before resubmitting rather than relying on the API to catch duplicates.

At $0.09/image, a 200-SKU catalog with 3 scene variants each runs $54 — worth comparing against the studio-photography cost of shooting that many context shots, especially for a catalog that gets reshuffled seasonally.

FAQ

Does grok-imagine-quality/image-to-image support batch or multi-image output in one call? No — one image_urls submission (1–3 reference images) produces one output image per task. Batch scenes by looping separate task calls, as shown above.

Can I control the exact camera angle of the output? Not directly — there's no camera/pose parameter. Orientation tends to re-settle to fit the new scene; if a specific angle matters, state it explicitly in the prompt alongside the "keep shape/color/proportions" instruction.

How is this different from the base-tier grok-imagine/image-to-image? The Quality tier costs more ($0.09–$0.11 vs. the base tier) but holds product identity more reliably across bigger scene changes. For straightforward background swaps, our base-tier e-commerce workflow guide covers the cheaper path — reach for Quality when the scene transformation is more dramatic (e.g., studio-to-lifestyle rather than background-only).

What if my source photo isn't on a public URL yet? Upload it to any object storage or CDN first — the task API resolves image_urls by fetching the URL server-side, so a local file path or data URI won't work.

Try it yourself

The full request/response shapes, a live playground, and current pricing are on the grok-imagine-quality/image-to-image model page. If you're new to the task API generally, the step-by-step integration guide walks through auth, polling, and error handling in more depth than covered here.

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