AI Product Photography Setup: 12 Steps, $0.30 a SKU [2026]

Product photography used to mean a studio, a lighting rig, and a day-rate photographer. By June 2026, about 67% of leading e-commerce operators had already budgeted for AI imaging tools, according to e-commerce analytics firm Photta, and that share of online sellers skipping the studio entirely keeps climbing as more generate scene backgrounds, lifestyle shots, and marketplace-ready variants with AI image models instead. The catch is that most sellers try one tool, get a warped logo or a product that changed color, and give up. The fix isn’t picking a single “best” generator — it’s building a small pipeline that keeps your actual product pixels untouched while AI handles only the background, lighting, and scene.

This tutorial walks through that exact setup: choosing the right AI image generator for each part of the job, keeping product fidelity intact with cutout-and-composite techniques, and automating the whole thing into a batch pipeline you can point at a full catalog. By the end you’ll have a working Python project that takes a folder of raw product photos and outputs marketplace-ready images at a fraction of studio cost.

Google · Preferred Sources

Don't miss new tech stories on Google

Add Tech Insider once in the Google app and our stories appear in your news suggestions.

Add Now

Why AI Product Photography Broke Out in 2026

Three things changed at once. First, image generators got good at following reference images instead of just prompts, so a product’s shape and label text survive a background swap — Photoroom’s product-fidelity model reached version 2 in August 2026, specifically tuned to catch the shifted logos and warped text that made earlier tools unreliable for catalog work. Second, per-image API pricing dropped low enough that generating ten scene variants per SKU costs less than one hour of a freelance retoucher. Third, marketplaces themselves started tolerating AI-assisted imagery as long as the product itself isn’t misrepresented, which pushed sellers to formalize a repeatable, defensible workflow rather than eyeballing outputs one at a time.

The models doing the heavy lifting today are Google’s Nano Banana Pro API, OpenAI’s GPT Image 2.5 (which added its Flare and Sunburst variants on September 8, 2026), Google’s Imagen 4, Alibaba’s Qwen-Image 3.0 (released July 21, 2026 and generally available from August 5), Black Forest Labs’ FLUX.2, and xAI’s Grok Imagine Image 2.0. Each handles product photography differently: some are strong at photorealistic reflections and shadows, some are cheaper per image, and some are better at rendering small text on packaging without turning it into gibberish. None of them is universally “best” for product photography — the right pick depends on whether you’re shooting glossy cosmetics, textured apparel, or gadgets with visible branding.

How This Compares to a Traditional Studio Shoot

The honest comparison isn’t AI versus photographer in the abstract — it’s cost and turnaround per revision. A studio day booking a photographer, a rented space, and basic retouching typically runs several hundred dollars and produces a fixed set of angles and backgrounds agreed on in advance. Asking for a different background after the shoot means booking another session. An AI-driven pipeline flips that: the upfront setup takes an afternoon, but every subsequent SKU or background variant costs cents and takes minutes, not days.

FactorTraditional studio shootAI-assisted pipeline (this tutorial)
Typical cost per SKU (5 variants)$40–$150 depending on market and photographer rate$0.30–$0.50 in API costs
Turnaround for a new background variantDays (re-booking required)Minutes
Consistency across a 200-SKU catalogHigh, but requires the same studio session for all SKUsHigh, driven by reusable scene prompt templates
Upfront investmentLow per session, recurring cost every batchHigher one-time setup, near-zero marginal cost after
Best fitHero campaign imagery, brand shoots needing human art directionLong-tail catalog images, frequent SKU refreshes, marketplace variants

Most sellers running this at scale don’t fully replace photography — they use it to cover the long tail of SKUs that would never get a dedicated studio session otherwise, while reserving a real shoot for the handful of hero products that anchor a campaign.

Measuring Whether AI-Generated Backgrounds Actually Help Conversion

Don’t roll this out to a full catalog on faith. Because the pipeline is cheap to run, it’s just as cheap to A/B test: generate both a plain white background and a lifestyle scene for the same SKU, split traffic evenly across both on the product page or ad creative, and let the platform’s existing analytics tell you which version actually converts better for that category. Some categories respond strongly to lifestyle context (home goods, apparel, anything sold on an emotional benefit) while others do better with a clean, neutral background that puts all the attention on the product itself (electronics, tools, anything sold on a spec sheet).

Run this test per category rather than assuming one answer applies to the whole catalog, and rerun it periodically — buyer preference for lifestyle versus plain-background imagery shifts with the season and with what competitors are doing on the same marketplace. Store the result of each test alongside the scene prompt that produced the winning image in your prompt library from earlier, so a future team member can see not just what the winning image looked like, but the exact prompt that generated it.

Prerequisites: What You Need Before Starting

Gather these before Step 1. Costs below are per-image API rates gathered from current provider pricing pages as of September 2026, not subscription bundles.

  • Python 3.11 or newer, with pip and a virtual environment tool
  • A Google AI Studio or Vertex AI account for Nano Banana Pro and Imagen 4 access (Nano Banana Pro runs about $0.134 per 1K/2K image and $0.24 per 4K image on standard pricing, dropping to roughly $0.067 in batch mode)
  • An OpenAI platform account with billing enabled for GPT Image 2 (roughly $0.006 per image at low quality up to about $0.21–$0.41 per image at high quality and 4K)
  • A Black Forest Labs API key for FLUX.2 if you want a lower-cost photorealistic option
  • An xAI account for Grok Imagine Image 2.0 if you want a mid-priced flagship alternative (around $0.04–$0.05 per image)
  • The rembg and Pillow Python libraries for background removal and compositing
  • Raw product photos shot against a plain background (a lightbox and a phone camera is enough — quality of the AI scene doesn’t fix a blurry source photo)
  • Roughly 30–60 minutes for initial setup and 5–10 minutes per SKU once the pipeline is running

A note on budget: a 200-SKU catalog generating four scene variants each, at an average $0.05 per image across providers’ raw APIs, runs about $40 in API costs — though if you go through a packaged AI product-imaging tool rather than calling the APIs directly, expect something closer to the $3–$12 per image that e-commerce analytics firm Photta reported teams were paying as of June 2026, since those tools bundle compositing and review on top of the raw generation cost. Either way, that’s the number to compare against a studio day rate when deciding whether this is worth building.

Step 1: Pick the Right Model for Your Product Category

Don’t default to whichever model you already have a subscription to. Product photography stresses different capabilities than general image generation: text legibility on packaging, color accuracy against a brand’s Pantone spec, and consistent reflections on glass or metal. The table below reflects current per-image API pricing and the strengths reported across current benchmarks and provider documentation as of September 2026 — note that OpenAI’s GPT Image 2.5 broke from flat per-image pricing and, per Capital & Compute, billed at $8 per million input tokens and $30 per million output tokens as of September 2026, so its effective cost per image now depends on prompt length and resolution rather than a single flat rate.

ModelPrice per image (standard)Max resolutionBest forWeak point for product shots
Nano Banana Pro$0.134 (1K/2K), $0.24 (4K)4KComplex scene composition, multi-reference conditioningHigher cost at scale
GPT Image 2$0.006–$0.21 by quality tier4K (high tier)Packaging text and logo legibilityHigh-quality tier gets expensive fast
Imagen 4 Standard$0.042KBalanced cost and photorealismLess fine control over shadow direction
Imagen 4 Fast$0.022KHigh-volume bulk background generationSofter detail on reflective surfaces
FLUX.2 Pro~$0.015–$0.0552KPhotorealistic lighting at lower costLess reliable on small embedded text
Grok Imagine Image 2.0$0.04 standard / $0.05 quality mode2KMid-priced flagship general useFewer product-specific fine-tuning controls

A practical rule that holds across most catalogs: use Imagen 4 Fast or FLUX.2 for bulk background exploration where you’re generating many throwaway variants to pick a direction, then switch to Nano Banana Pro or GPT Image 2 for the final, published version of each SKU where fidelity matters more than cost per image.

Step 2: Set Up Your Project and API Keys

Create a project folder and a virtual environment, then install the dependencies you’ll need for API calls, image compositing, and background removal.

mkdir ai-product-photos && cd ai-product-photos
python3 -m venv venv
source venv/bin/activate
pip install requests pillow rembg numpy python-dotenv

mkdir -p raw_products generated_scenes final_output
touch .env

Add your provider keys to .env. Never commit this file — add it to .gitignore immediately.

GOOGLE_AI_API_KEY=your_google_ai_studio_key
OPENAI_API_KEY=your_openai_key
BFL_API_KEY=your_black_forest_labs_key

Step 3: Shoot and Prepare Clean Source Photos

This is the step most tutorials skip, and it’s the one that determines whether the whole pipeline works. AI image generators are far better at inventing a background around a product than they are at inventing a believable product from scratch. So the source photo needs to be clean: even lighting, a plain background (white or solid color), and the product filling most of the frame with no motion blur.

A phone camera on a tripod, one softbox or a window with diffused daylight, and a $15 collapsible lightbox is enough for this step. Shoot every SKU from the same angle set (front, three-quarter, top) so your batch pipeline can apply the same background treatment consistently across the catalog.

Step 4: Remove the Background and Extract a Clean Product Cutout

Before calling any AI image generator, isolate the product with a transparent-background cutout. This is the piece that keeps your product pixels exact and untouched later, no matter what background the AI model generates.

from rembg import remove
from PIL import Image
import os

def cutout_product(input_path, output_path):
    with open(input_path, 'rb') as f:
        input_data = f.read()
    output_data = remove(input_data)
    with open(output_path, 'wb') as f:
        f.write(output_data)

for filename in os.listdir('raw_products'):
    if filename.lower().endswith(('.jpg', '.jpeg', '.png')):
        name = os.path.splitext(filename)[0]
        cutout_product(
            f'raw_products/{filename}',
            f'generated_scenes/{name}_cutout.png'
        )
        print(f'Cutout saved: {name}_cutout.png')

Check every cutout by eye before moving on. rembg is reliable on solid backgrounds but occasionally clips thin elements like jewelry chains or transparent bottle necks — those need a quick manual touch-up in any editor with a layer mask.

Step 5: Generate Background Scenes With Nano Banana Pro

With a clean cutout in hand, generate the scene separately. Describe the setting, lighting, and surface — not the product, since the AI never touches the actual product pixels in this workflow.

import requests
import os
from dotenv import load_dotenv

load_dotenv()
API_KEY = os.getenv('GOOGLE_AI_API_KEY')

def generate_scene(prompt, output_path, resolution='2K'):
    url = 'https://generativelanguage.googleapis.com/v1beta/models/nano-banana-pro:generateImage'
    headers = {'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json'}
    payload = {
        'prompt': prompt,
        'resolution': resolution,
        'aspect_ratio': '1:1'
    }
    response = requests.post(url, json=payload, headers=headers, timeout=60)
    response.raise_for_status()
    image_bytes = response.content
    with open(output_path, 'wb') as f:
        f.write(image_bytes)
    return output_path

scene_prompt = (
    "A minimalist marble countertop under soft natural window light, "
    "pale gray studio background, soft shadow falling to the right, "
    "shallow depth of field, no objects on the counter, empty center "
    "space reserved for a product to be composited in later"
)

generate_scene(scene_prompt, 'generated_scenes/marble_scene_2k.png')

Notice the prompt explicitly asks for an empty center space. That single instruction cuts down dramatically on the AI trying to fill that spot with its own invented object, which is the single most common failure mode in this workflow.

Writing Prompts That Actually Preserve Product Fidelity

Because the AI model in this workflow never sees the actual product, prompt writing for product photography backgrounds is a different discipline than prompting for a hero image where the product itself is generated. The goal shifts from “describe everything” to “describe the environment precisely and reserve the product’s space explicitly.” A few patterns consistently produce better composite-ready scenes:

  • Name the light direction explicitly. “Soft light from the upper left” gives you a shadow direction you can match in Step 6, instead of a scene with ambiguous or flat lighting that makes any composited shadow look wrong.
  • Specify the surface material, not just the setting. “Matte concrete counter” and “polished marble counter” produce very different reflection behavior, which matters if your product itself is glossy or matte.
  • Always include a negative instruction against center-frame objects. Phrases like “empty center space, no props, no objects in the foreground” measurably reduce how often the model tries to invent something to fill the void where your product will go.
  • Lock the aspect ratio to your target platform up front. Generating a 1:1 scene and cropping to 4:5 after the fact wastes usable canvas; request the final aspect ratio from the model directly.
  • Keep a prompt library, not one-off prompts. Save every scene prompt that produced a usable result in a shared file (like the SCENE_PROMPTS dictionary in Step 7) so the whole team reuses proven wording instead of re-discovering it per SKU.

Run the same scene prompt through two or three of the models from the Step 1 comparison table before committing to one. A prompt that produces a clean, compositable scene on FLUX.2 doesn’t always translate directly to Nano Banana Pro or Imagen 4 — each model interprets lighting and material descriptions slightly differently, and five minutes of cross-testing at the prompt stage saves a much larger rework later in the batch.

Step 6: Composite the Real Product Onto the Generated Scene

This is the step that makes the whole pipeline trustworthy: the product in the final image is still your original photo, pixel for pixel, just placed on top of an AI-generated background.

from PIL import Image, ImageFilter, ImageEnhance

def composite_product(scene_path, cutout_path, output_path, position=(0.5, 0.6), scale=0.55):
    scene = Image.open(scene_path).convert('RGBA')
    cutout = Image.open(cutout_path).convert('RGBA')

    scene_w, scene_h = scene.size
    target_w = int(scene_w * scale)
    ratio = target_w / cutout.width
    target_h = int(cutout.height * ratio)
    cutout = cutout.resize((target_w, target_h), Image.LANCZOS)

    # Soft drop shadow so the product doesn't look pasted on
    shadow = Image.new('RGBA', cutout.size, (0, 0, 0, 0))
    shadow_layer = Image.new('RGBA', cutout.size, (0, 0, 0, 90))
    shadow.paste(shadow_layer, (0, 0), cutout.split()[-1])
    shadow = shadow.filter(ImageFilter.GaussianBlur(12))

    x = int(scene_w * position[0] - target_w / 2)
    y = int(scene_h * position[1] - target_h / 2)

    scene.paste(shadow, (x + 8, y + 14), shadow)
    scene.paste(cutout, (x, y), cutout)

    scene.convert('RGB').save(output_path, quality=95)
    return output_path

composite_product(
    'generated_scenes/marble_scene_2k.png',
    'generated_scenes/product_a_cutout.png',
    'final_output/product_a_marble_final.jpg'
)

Because the product itself came straight from your original photo, brand colors, logos, and packaging text are guaranteed accurate — there’s nothing for the AI model to hallucinate, since it never generated the product at all.

Step 7: Batch the Pipeline Across a Full Catalog

Once the single-image flow works, wrap it in a loop that processes every SKU against a set of scene prompts, with basic rate limiting so you don’t get throttled by the provider.

import time
import json

SCENE_PROMPTS = {
    'marble': "Minimalist marble countertop, soft window light, pale gray background, empty center space",
    'wood': "Warm oak wood surface, morning sunlight from the left, blurred green plant in background, empty center space",
    'studio': "Seamless white studio backdrop, three-point softbox lighting, subtle floor reflection, empty center space",
}

def process_catalog(catalog_folder='raw_products'):
    results = []
    for filename in os.listdir(catalog_folder):
        if not filename.lower().endswith(('.jpg', '.jpeg', '.png')):
            continue
        sku = os.path.splitext(filename)[0]
        cutout_path = f'generated_scenes/{sku}_cutout.png'
        cutout_product(f'{catalog_folder}/{filename}', cutout_path)

        for scene_name, prompt in SCENE_PROMPTS.items():
            scene_path = f'generated_scenes/{sku}_{scene_name}.png'
            try:
                generate_scene(prompt, scene_path)
                final_path = f'final_output/{sku}_{scene_name}.jpg'
                composite_product(scene_path, cutout_path, final_path)
                results.append({'sku': sku, 'scene': scene_name, 'status': 'ok', 'path': final_path})
            except Exception as e:
                results.append({'sku': sku, 'scene': scene_name, 'status': 'error', 'error': str(e)})
            time.sleep(1.5)  # basic rate limiting

    with open('final_output/batch_report.json', 'w') as f:
        json.dump(results, f, indent=2)
    return results

if __name__ == '__main__':
    report = process_catalog()
    ok = sum(1 for r in report if r['status'] == 'ok')
    print(f'Completed {ok}/{len(report)} images')

For catalogs beyond a few hundred SKUs, swap the flat loop for a job queue (Redis plus a worker pool) so failures on one SKU don’t stall the rest of the run — the same pattern covered in a multi-model AI image pipeline setup if you’re routing across several providers by cost or load.

Testing Your Pipeline on a Small Batch Before a Full Catalog Run

Don’t point the batch script at a 500-SKU catalog on the first run. Pull a representative sample of five to ten products spanning your hardest categories — anything with fine text, anything glossy or reflective, anything with a distinctive brand color — and run the full pipeline against just that sample first.

Review the sample output against three checks: does the brand color match the original product photo when placed side by side, does any packaging text remain legible at the target resolution, and does the drop shadow direction match the scene’s stated light direction. If two or more of the sample images fail any of these checks, the fix is almost always in the scene prompt or the compositing scale and position values, not the model choice. Only after the small batch passes cleanly should the same configuration run against the full catalog, since a bad prompt template repeated across 500 SKUs wastes both API spend and review time.

Step 8: Match Marketplace Image Requirements

Every marketplace has its own rules for product images: minimum resolution, aspect ratio, background rules for the primary listing photo, and file size caps. Add a validation pass after compositing so nothing gets rejected at upload time.

PlatformPrimary image background ruleMinimum resolutionMax file size
AmazonPure white required for the main image; lifestyle shots allowed as secondary images1000px on longest side (2000px+ recommended for zoom)10MB
Shopify (self-hosted store)No fixed rule; brand consistency recommended2048px recommended20MB
EtsyNo fixed rule for background2000px on shortest side recommended—
Walmart MarketplaceWhite or light gray background for the primary image1000px minimum, 2000px recommended5MB
def validate_for_marketplace(image_path, min_dimension=1000, max_size_mb=10):
    img = Image.open(image_path)
    width, height = img.size
    file_size_mb = os.path.getsize(image_path) / (1024 * 1024)

    issues = []
    if min(width, height) < min_dimension:
        issues.append(f'Resolution too low: {width}x{height}')
    if file_size_mb > max_size_mb:
        issues.append(f'File size too large: {file_size_mb:.1f}MB')
    if img.mode not in ('RGB', 'RGBA'):
        issues.append(f'Unexpected color mode: {img.mode}')

    return issues

for f in os.listdir('final_output'):
    if f.endswith('.jpg'):
        problems = validate_for_marketplace(f'final_output/{f}')
        if problems:
            print(f'{f}: {problems}')

Step 9: Upscale for Print and Zoom-Heavy Listings

Marketplace zoom features and print catalogs need more resolution than a 2K generated scene provides. Rather than re-generating at 4K for every variant (which multiplies your API cost), upscale only the images you’ve selected as finalists.

from PIL import Image

def upscale_lanczos(input_path, output_path, scale_factor=2):
    img = Image.open(input_path)
    new_size = (img.width * scale_factor, img.height * scale_factor)
    upscaled = img.resize(new_size, Image.LANCZOS)
    upscaled.save(output_path, quality=95)
    return output_path

upscale_lanczos('final_output/product_a_marble_final.jpg', 'final_output/product_a_marble_4k.jpg', scale_factor=2)

Lanczos resampling in Pillow is a reasonable free option for a 2x bump. For anything beyond that, a dedicated AI upscaler produces cleaner edges on text and fine texture, but budget the extra per-image cost only for images that made the final cut.

Step 10: Build a Review Queue Before Anything Goes Live

Never auto-publish generated images straight to a live listing. Build a simple review step — even a shared folder with a naming convention works for small catalogs — where a human checks for the failure modes covered in the pitfalls section below before anything reaches the storefront.

import shutil

def move_to_review(final_output_folder='final_output', review_folder='pending_review'):
    os.makedirs(review_folder, exist_ok=True)
    for f in os.listdir(final_output_folder):
        if f.endswith(('.jpg', '.jpeg')):
            shutil.copy(f'{final_output_folder}/{f}', f'{review_folder}/{f}')
    print(f'{len(os.listdir(review_folder))} images queued for manual review')

move_to_review()

Step 11: Add Batch Branding and Watermark Overlays

For lifestyle and social images (not marketplace primary photos, which usually can’t carry watermarks), add a consistent brand mark in code rather than manually in an editor, so every image in a batch gets identical placement and opacity.

def add_watermark(image_path, watermark_path, output_path, opacity=0.6, margin=30):
    base = Image.open(image_path).convert('RGBA')
    mark = Image.open(watermark_path).convert('RGBA')

    mark_w = int(base.width * 0.12)
    ratio = mark_w / mark.width
    mark = mark.resize((mark_w, int(mark.height * ratio)), Image.LANCZOS)

    alpha = mark.split()[-1].point(lambda p: int(p * opacity))
    mark.putalpha(alpha)

    position = (base.width - mark.width - margin, base.height - mark.height - margin)
    base.paste(mark, position, mark)
    base.convert('RGB').save(output_path, quality=95)

add_watermark('final_output/product_a_marble_final.jpg', 'assets/logo.png', 'final_output/product_a_marble_branded.jpg')

Step 12: Track Cost and Choose Your Steady-State Model Mix

Log every API call’s cost so you can see, after a few hundred images, which provider is actually earning its place in your pipeline for your specific product category.

import csv
from datetime import datetime

def log_cost(sku, provider, resolution, cost, log_file='final_output/cost_log.csv'):
    file_exists = os.path.isfile(log_file)
    with open(log_file, 'a', newline='') as f:
        writer = csv.writer(f)
        if not file_exists:
            writer.writerow(['timestamp', 'sku', 'provider', 'resolution', 'cost_usd'])
        writer.writerow([datetime.utcnow().isoformat(), sku, provider, resolution, cost])

log_cost('product_a', 'nano-banana-pro', '2K', 0.134)

Most sellers who run this for a full quarter land on a mixed strategy: a cheaper model like Imagen 4 Fast or FLUX.2 for early exploration passes, and a higher-fidelity model like Nano Banana Pro or GPT Image 2 reserved for the small number of hero images that actually go on the primary listing slot.

Output Examples: What Success Looks Like

A well-run pipeline on a skincare bottle SKU typically produces: one Amazon-compliant pure-white primary image, three lifestyle variants (marble bathroom counter, wood shelf, soft studio gradient) for the secondary image slots, and one square social-ready crop with a watermark for Instagram. Total generation cost across five variants at a mixed $0.02–$0.13 per image runs roughly $0.30–$0.50 per SKU, plus the one-time setup cost of the pipeline itself.

Scaling to Lifestyle Sets and Social Content

Once the core catalog pipeline is stable, the same cutout-and-composite approach extends naturally to lifestyle content that used to require its own separate shoot. A single product cutout can be composited against a dozen different scene templates — a kitchen counter, a gym bag, an office desk, a gift-wrapped table — to produce a week’s worth of social media variety from one original product photo. Because the compositing step is scriptable, generating ten social crops for a new seasonal campaign is a matter of adding new entries to the SCENE_PROMPTS dictionary from Step 7 and re-running the batch, rather than re-booking a shoot every time a marketing calendar changes.

The same principle applies to seasonal refreshes: swap a summer beach scene prompt for a winter fireplace scene prompt against the same product cutouts, and the whole catalog gets a seasonal look without touching a camera. Keep a versioned folder of scene prompt sets by season or campaign so past looks stay reproducible if a product needs to return to an earlier campaign style.

Common Pitfalls and How to Avoid Them

  • Letting the AI generate the product, not just the scene. Every model still occasionally shifts a label color or adds an extra button that isn’t on your real product. The cutout-and-composite approach in Step 6 avoids this entirely by never asking the model to draw the product.
  • Skipping the “empty center space” instruction in scene prompts. Without it, models tend to fill that spot with an object of their own choosing, which then has to be manually removed before compositing.
  • Ignoring shadow direction consistency. If your scene has light coming from the left but your composited drop shadow falls to the right, the image reads as fake immediately. Match the shadow direction described in your scene prompt.
  • Publishing straight from the batch script. Automated pipelines will occasionally produce a distorted or unusable frame. A review queue (Step 10) catches these before they reach a live listing.
  • Using the same model for every product category. A model that’s excellent for cosmetics on marble may render textured fabric or metal reflections poorly. Re-test your model choice per category rather than assuming one winner for the whole catalog.
  • Overspending on 4K generation for exploratory variants. Generate cheap, low-resolution drafts first, pick the winning composition, then upscale or regenerate only that one at full resolution.
  • Forgetting marketplace background rules. A gorgeous lifestyle shot gets rejected as the primary Amazon image if it isn’t pure white — keep one plain-background version generated specifically for that slot.

Troubleshooting

  • Cutout has ragged edges around fine details: rembg struggles with hair-thin elements like jewelry chains or mesh fabric; run a manual mask refinement pass in an image editor for those specific SKUs.
  • Generated scene has visible seams where the product was placed: Add a Gaussian blur of 1–2px to the cutout’s edge alpha channel before compositing to soften the transition.
  • API returns a 429 rate-limit error mid-batch: Increase the time.sleep() value in the batch loop and add exponential backoff with retries rather than failing the whole run.
  • Product colors look slightly different after compositing: Check that your composite script isn’t converting through a color profile that shifts hues — save in the same color space (sRGB) throughout the pipeline.
  • Shadows look painted on rather than physically grounded: Reduce shadow opacity and increase blur radius; a shadow that’s too sharp and too dark is the most common tell of a composited image.
  • 4K upscale introduces visible artifacts on packaging text: Lanczos resampling can soften small text further; regenerate that specific frame at native 4K resolution instead of upscaling a 2K source.
  • Batch script silently skips some files: Check the file extension filter — phone cameras sometimes export HEIC files that the script’s .jpg/.jpeg/.png filter won’t catch; convert HEIC to JPEG first.
  • Cost log shows higher spend than expected: Confirm you’re not accidentally regenerating scenes for SKUs that already have approved output; add a check for existing files before calling the API again.
  • Watermark appears blurry on high-resolution outputs: Use a vector or high-resolution source logo file; scaling up a low-resolution PNG watermark degrades badly at 4K.

Advanced Tips

Once the core pipeline is stable, a few refinements pay off at scale. Lock the generation seed for a given scene template so re-runs (say, after a failed API call) reproduce the same background rather than a new random variant — this matters when a client has approved one specific look and you need to regenerate at a different resolution. For brands with a very specific aesthetic that off-the-shelf prompts can’t reliably reproduce, training a lightweight custom model on your brand’s past photography, as covered in the custom AI image LoRA guide, gets closer to on-brand output with less prompt trial and error. And if you’re generating at real volume across a product team rather than a single catalog, route requests across providers automatically by cost and current load rather than hardcoding one model, which is the approach detailed in the multi-model AI image pipeline setup.

Keep a running comparison of per-provider pricing too — rates on AI image generator API costs shift every few months as providers compete on price, and a mix that made sense in the spring may not be the cheapest option by the following quarter. For teams weighing Imagen 4 specifically against Nano Banana Pro on a cost-per-output basis, the Imagen 4 API tutorial covers its full pricing tiers and resolution options in more depth.

Complete Working Project Structure

Putting every step together, the finished project looks like this:

ai-product-photos/
├── .env
├── raw_products/          # original phone/studio photos
├── generated_scenes/      # cutouts and AI-generated backgrounds
├── final_output/          # composited, validated, branded images
│   ├── cost_log.csv
│   └── batch_report.json
├── pending_review/        # queued for human approval
├── assets/
│   └── logo.png
├── cutout.py
├── generate_scene.py
├── composite.py
├── validate.py
├── upscale.py
├── watermark.py
└── batch_pipeline.py      # ties every step together

Run python batch_pipeline.py against a folder of raw product photos and it produces marketplace-validated, branded, cost-logged output ready for the review queue — the same pipeline a small e-commerce team can run every time a new product batch arrives, without booking a studio.

Each script in the project is a standalone function, which matters more than it might first appear. Swapping generate_scene() to call a different provider’s endpoint doesn’t touch the cutout, compositing, validation, upscaling, or logging code at all, since every function communicates through plain file paths rather than a provider-specific object. That separation is what makes it realistic to keep this pipeline running for years even as individual AI image models get replaced by their successors every few months — the compositing and marketplace validation logic, which is the part that actually took the longest to get right, doesn’t need to change when Nano Banana Pro gets replaced by whatever Google ships next.

For background on the underlying models used here, OpenAI’s image generation API documentation, Google’s Gemini API pricing reference, and Black Forest Labs’ FLUX developer docs all publish current rate cards worth checking before committing to a provider mix. The rembg project on GitHub and the Pillow imaging library documentation cover the compositing tools this pipeline relies on in more depth than fits here, and Google Cloud’s Vertex AI image generation guide is useful if you scale onto enterprise infrastructure later.

Frequently Asked Questions

Do I need a professional camera for this workflow?
No. A phone camera on a tripod with even, diffused lighting produces a clean enough source photo, since the AI model never touches the product itself — it only generates the background around your real cutout.

Which AI image generator is cheapest for bulk product photography?
Imagen 4 Fast at $0.02 per image and FLUX.2 in the roughly $0.015–$0.055 range are the lowest-cost options among current flagship models, making them good picks for exploratory batches before you commit to a final scene.

Can I use these images directly as my Amazon primary listing photo?
Only if the background is pure white, since Amazon requires a plain white background for the main image slot. Generate a dedicated studio-white variant for that slot and reserve lifestyle scenes for secondary images.

Why composite instead of just asking the AI to generate the whole product photo?
Asking a model to redraw your actual product risks subtle color shifts, altered logos, or invented details — all of which can misrepresent the item you’re selling. Compositing keeps the real product pixels intact and only lets AI handle the background.

How much does it cost to process a 200-SKU catalog?
At roughly $0.05 average per generated image and four scene variants per SKU, a 200-SKU catalog runs approximately $40 in API costs, plus the one-time setup time for the pipeline itself.

Do I need to disclose that product images used AI-generated backgrounds?
Marketplace and advertising disclosure rules vary by platform and region and continue to evolve, so check your specific marketplace’s current policy on AI-assisted imagery before publishing at scale, and keep your product cutouts unaltered to avoid any claim of misrepresentation.

What’s the biggest quality difference between the models covered here?
GPT Image 2.5 — including the Flare and Sunburst variants OpenAI shipped on September 8, 2026 — tends to render small packaging text more reliably, Nano Banana Pro handles complex multi-element scene composition well, Alibaba’s newly available Qwen-Image 3.0 is worth benchmarking as a lower-cost alternative, and FLUX.2 delivers photorealistic lighting at a lower per-image cost — pick based on which failure mode matters least for your specific product category.

Can this pipeline handle apparel and textured products, not just hard goods?
Yes, though textured materials like fabric benefit from testing more scene prompt variations, since folds and texture interact with generated lighting differently than a rigid product like a bottle or box.

Should I still hire a photographer at all if this pipeline works?
For most catalogs, yes, for a smaller subset of images. Reserve a real photo shoot for hero campaign images and any shot requiring genuine human art direction, and use the AI pipeline to cover the long tail of SKUs and background variants that wouldn’t get a dedicated session otherwise.

What happens if an AI provider changes its pricing or deprecates a model?
Because the pipeline treats each provider as a swappable function behind a common interface, updating to a new model version or provider means changing the API call in one file, not rewriting the compositing, validation, or batching logic that makes up most of the project.

Elias Virtanen

Elias Virtanen

Cybersecurity Analyst

Elias Virtanen is the Cybersecurity Analyst at Tech Insider, bringing hands-on expertise from his background in penetration testing and security consulting. He previously worked as a security researcher at F-Secure in Helsinki, where he focused on threat intelligence and vulnerability disclosure. Elias covers ransomware trends, zero-trust architecture, and the evolving regulatory landscape including NIS2 and the EU Cyber Resilience Act. He holds a CISSP certification and an MSc in Information Security from Aalto University.

View all articles