AI Apparel Photography API — Colorway Variants at Scale

Sep 25, 2026·7 min read

A clothing brand has one flat-lay photo of a t-shirt sample in navy, but the product page needs the same shirt in five more colorways before the listing goes live — and the factory won't ship the other colorway samples for another two weeks. Re-shooting five more flat-lays once the samples finally arrive means the listing sits incomplete for the entire pre-order window, and a customer comparing colorways from a mix of real photos and placeholder swatches is less likely to commit to a size and color before checkout. Generating each colorway from the one sample photo lets the full listing go live on day one, with real product photos standing in for samples that haven't been cut yet.

Direct answer: a reference-guided image generation API takes one apparel photo as image input plus a prompt describing the target color, and outputs a new image that holds the garment's cut, fabric drape, and fold pattern consistent while changing only the color — no second sample or re-shoot required.

How Does an API Generate Apparel Color Variants From One Photo?

Reference-guided generation anchors the output to the source photo's silhouette, seam lines, and fabric fold pattern, then applies the color change described in the prompt. This differs from text-to-image generation, which has no source garment to match and would produce a plausible-looking shirt rather than the exact cut shipping to customers — a real risk in apparel, where a slightly different sleeve length or collar shape reads as a different product to a shopper who already tried the sample on in a fitting room photo shared internally.

Fabric type changes how a color shift renders, so naming the material in the prompt matters: "ribbed cotton knit" holds shadow and stretch lines differently than "smooth silk blend," and leaving the material unstated lets the model default to whichever finish the reference photo already shows — wrong when the same cut ships in both a cotton and a poly-blend version.

Does the API Handle Both Flat-Lay and On-Model Shots?

Yes, but each shot type needs its own reference photo. A flat-lay reference produces flat-lay colorway variants, and an on-model reference produces on-model variants — the API does not convert a flat-lay photo into an on-model shot in the same generation, since that would require inferring how the garment drapes on a body the reference photo never showed. Brands running both shot types typically photograph one sample flat and one sample on a model, then generate the remaining colorways from each reference separately.

Which Model Fits Apparel Product Photography?

Nano Banana Pro's reference-guided mode holds seam placement, fabric fold, and print alignment consistent across color changes, which matters for apparel because a shifted logo print or distorted seam reads as a manufacturing defect on a product category where customers zoom in on stitching before buying. GPT-image-2 fits smaller instruction-based touch-ups — background swap, wrinkle cleanup, or a shadow adjustment — on a photo that's otherwise already final.

Model Mode Resolution / price Fabric consistency Best for
Nano Banana Pro Reference-guided 1K $0.030 / 2K $0.030 / 4K $0.042 High Full colorway sets from one flat-lay or on-model photo
Nano Banana 2 Reference-guided 1K $0.020 / 4K $0.036 Medium-high Lower-cost variant runs for internal merchandising review
GPT-image-2 Instruction-based edit $0.014/image N/A (edits existing photo) Background swap or wrinkle cleanup on a near-final shot

For a storefront-facing colorway launch, Nano Banana Pro's consistency at 2K resolution is worth the small premium over Nano Banana 2 — a warped seam or misaligned print reads as a defect to a shopper comparing colorways side by side, not a rendering quirk.

How Do I Generate an Apparel Color Variant via API?

Submit the base product photo as image input with a prompt describing the target color and fabric finish; the endpoint returns a job ID to poll for the finished image.

import requests, time

API_KEY = "YOUR_KEY"
BASE = "https://genrelay.ai/v1"

def generate_variant(reference_url, color, material):
    r = requests.post(
        f"{BASE}/images/generations",
        headers={"Authorization": f"Bearer {API_KEY}"},
        json={
            "model": "nano-banana-pro",
            "prompt": f"same cut, seams, and fabric fold, "
                      f"{color} {material}, flat-lay product shot, "
                      f"studio lighting, white background",
            "image": reference_url,
            "resolution": "2k",
        },
    )
    return r.json()["id"]

job_id = generate_variant(
    "https://cdn.example.com/tshirt-navy-flatlay.jpg",
    "forest green",
    "ribbed cotton knit",
)

Poll the job until it completes, since reference-guided generation is asynchronous:

def wait_for_result(job_id, timeout=90):
    start = time.time()
    while time.time() - start < timeout:
        status = requests.get(
            f"{BASE}/images/generations/{job_id}",
            headers={"Authorization": f"Bearer {API_KEY}"},
        ).json()
        if status["status"] == "completed":
            return status["output_url"]
        if status["status"] == "failed":
            raise RuntimeError(status.get("error"))
        time.sleep(2)
    raise TimeoutError(f"Job {job_id} did not finish in {timeout}s")

image_url = wait_for_result(job_id)

How Do I Batch a Full Colorway Line?

Loop over the colorway list and submit each as its own job, holding concurrency low enough to stay under the account's rate limit — see the batch image generation guide for the concurrency and retry pattern this scales to.

colorways = [
    ("forest green", "ribbed cotton knit"),
    ("charcoal gray", "ribbed cotton knit"),
    ("burgundy", "ribbed cotton knit"),
    ("cream", "ribbed cotton knit"),
    ("black", "ribbed cotton knit"),
]

jobs = []
for color, material in colorways:
    job_id = generate_variant(reference_url, color, material)
    jobs.append((color, job_id))

results = [(color, wait_for_result(j)) for color, j in jobs]
for color, url in results:
    print(f"{color}: {url}")

What Does a Full Launch Cost?

Five colorways at 2K resolution on Nano Banana Pro cost 5 × $0.030 = $0.15. A wider line spanning three cuts in five colorways each costs 15 × $0.030 = $0.45.

Launch size Images Model Cost
Single cut, 5 colorways 5 Nano Banana Pro, 2K $0.15
Three cuts, 5 colorways each 15 Nano Banana Pro, 2K $0.45
Internal merchandising review pass 15 Nano Banana 2, 1K $0.30

Running an internal merchandising review pass on Nano Banana 2 before committing the final set to Nano Banana Pro keeps early-stage colorway decisions cheap without touching the launch-quality model until the line is finalized.

Internal Links

FAQ

Can the API generate a pattern change (stripes, prints) instead of a solid color swap?
Yes — describe the pattern separately from the base color in the prompt, and the two attributes can be varied independently across a single reference photo.

Does it preserve logo placement and print alignment?
It approximates logo and print placement based on the reference photo's resolution; for prints that must stay pixel-exact (brand logos, size charts printed on the garment), plan on a manual overlay pass rather than relying on the model to reproduce small print details precisely.

Can one API call generate both a flat-lay and an on-model shot from the same reference?
No — each shot type needs its own reference photo. Generate flat-lay variants from a flat-lay reference and on-model variants from an on-model reference as separate jobs.

What resolution is needed for a product listing versus a lookbook print?
2K covers most e-commerce listing and zoom needs; 4K adds a $0.012 premium per image and is worth it mainly for print lookbooks or large in-store display graphics.

Is there a free tier to test colorway consistency before a full line launch?
Yes. GenRelay includes free credits on signup, enough to generate a handful of colorway variants from one reference photo before committing to a full line batch.


As of September 2026. Pricing subject to change — verify current rates at genrelay.ai.

Related posts

Join our DiscordAI Apparel Photography API — Colorway Variants at Scale — GenRelay