AI Bakery Photography API — Filling and Glaze Variants

Oct 5, 2026·6 min read

A bakery has one clean studio photo of its signature croissant — laminated layers visible, glaze catching the light — and the spring menu calls for four filling variants (almond, chocolate, raspberry, lemon) plus a pumpkin-spice version for the fall catalog, months before the kitchen will actually bake all of them in volume. Booking a food photographer for every filling and seasonal glaze change costs more than most bakeries spend on the batch of pastries being photographed, and a seasonal item often sells out before a reshoot could be scheduled anyway. Generating the filling and glaze variants from the one croissant already photographed answers "what does the fall lineup look like on the shelf" without a single extra bake.

Direct answer: a reference-guided image generation API takes the existing studio pastry photo as input plus a prompt describing the new filling, glaze, or seasonal decoration, and returns a new image that holds the pastry's shape and lamination fixed while changing only the described filling color, glaze, or topping — no reshoot per flavor, no waiting on a baking run.

How Does an API Generate Bakery Product Variants From One Studio Photo?

Reference-guided generation anchors the output to the pastry's fixed geometry — the croissant's lamination layers, a cake's silhouette, a loaf's crust shape — then renders the described filling, glaze, or topping change around it. This differs from plain text-to-image generation, which has no source pastry to match and produces a plausible-looking croissant rather than the exact shape and size shipping to the display case, a real risk when a menu photo needs to match what a customer actually picks up.

As of October 2026, GenRelay exposes three image models through one endpoint for this workflow:

Model Best for 1K price 4K price Editing support
Nano Banana Pro Reference-guided filling, glaze, and seasonal topping swaps $0.030 $0.042 Yes, strong consistency
Nano Banana 2 Faster batch variants, slightly lower consistency $0.020 $0.036 Yes
GPT-image-2 Instruction-based edits (swap a drizzle color, add sprinkles) $0.014/image $0.014/image Yes, instruction-driven

Nano Banana Pro holds lamination and crumb structure most reliably across a full filling change, which matters when the glaze needs to stay glossy and consistent while the interior color changes per flavor. GPT-image-2 fits small, targeted edits — adding seasonal sprinkles or recoloring a drizzle — better than a full filling restyle.

How Do I Call the API to Generate a Filling or Glaze Variant?

Authenticate with a bearer token and send the source photo plus a prompt describing the filling or glaze change. Here's a minimal working request using Nano Banana Pro:

import requests

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

with open("croissant_studio.jpg", "rb") as f:
    r = requests.post(
        f"{BASE}/images/generations",
        headers={"Authorization": f"Bearer {API_KEY}"},
        files={"reference_image": f},
        data={
            "model": "nano-banana-pro",
            "prompt": (
                "Same croissant, same lamination and shape, filling "
                "swapped to dark chocolate visible at the cut edge, "
                "glossy chocolate glaze drizzle on top, studio "
                "lighting unchanged."
            ),
            "resolution": "2k",
        },
    )
job = r.json()
image_url = job["data"][0]["url"]

For a full flavor lineup, batch the same reference image against a list of prompts rather than calling the endpoint one at a time:

import concurrent.futures

flavors = [
    "filling swapped to almond cream, toasted almond flakes on top",
    "filling swapped to dark chocolate, glossy chocolate glaze drizzle",
    "filling swapped to raspberry, pink glaze, fresh raspberry garnish",
    "pumpkin-spice filling, cinnamon-sugar dusting, autumn backdrop",
]

def generate(prompt):
    with open("croissant_studio.jpg", "rb") as f:
        r = requests.post(
            f"{BASE}/images/generations",
            headers={"Authorization": f"Bearer {API_KEY}"},
            files={"reference_image": f},
            data={"model": "nano-banana-pro", "prompt": prompt, "resolution": "2k"},
        )
    return r.json()["data"][0]["url"]

with concurrent.futures.ThreadPoolExecutor(max_workers=3) as pool:
    results = list(pool.map(generate, flavors))

Both calls are synchronous — image generation returns a URL directly in the response rather than requiring a polling loop, unlike video generation jobs.

What Does a Full Seasonal Launch Cost?

Cost scales with resolution and image count, not with how different each filling looks from the studio original. A bakery launching 4 filling variants from one croissant photo — 4 images — at Nano Banana Pro's 2K price of $0.030 per image costs $0.12 for the full set. Running the same 4 images at 4K for print menu boards costs $0.168 at $0.042 per image. A bakery generating a seasonal glaze and topping variant across 6 menu items — 12 images — costs $0.36 at 2K.

Scope Images Model/resolution Total cost
Single croissant, 4 filling variants 4 Nano Banana Pro, 2K $0.12
Same set, print-quality menu board 4 Nano Banana Pro, 4K $0.168
6 items × seasonal glaze/topping variant 12 Nano Banana Pro, 2K $0.36
6 items, instruction-only drizzle swap 6 GPT-image-2 $0.084

At this price point, generating a full seasonal lineup costs less than the flour and butter for a single test bake, which is why most bakeries generate the filling and glaze variants first and reserve an actual baking run for the flavors that sell well enough to justify kitchen time.

How Do I Keep the Pastry Recognizable Across Variants?

Keep every prompt change scoped to the filling, glaze, topping, or background — never the pastry's shape, lamination, or crust structure — since those are exactly the elements reference-guided generation is designed to hold fixed. If a variant starts drifting (the lamination flattens, the croissant gets larger), the fix is almost always a prompt that's too aggressive about "reimagining" the pastry rather than refilling it; rephrase toward "same croissant, same shape and lamination, change only the filling and surface decoration."

FAQ

Does the API support video, not just photos, for bakery product showcases?
Yes — GenRelay's video models (Veo 3.1 Lite, Grok Imagine) can turn a still pastry photo into a short drizzle, slice, or steam clip. See the bakery and pastry video API guide for pricing and code.

Can I edit a specific detail instead of restyling the whole pastry?
Yes — GPT-image-2 handles instruction-based edits like "add sprinkles" or "change the drizzle to caramel" at $0.014 per image, cheaper than a full Nano Banana Pro restyle when the change is small.

Will the generated pastry pass as the real product to a customer comparing it to the one they receive?
It should match the real shape and lamination closely enough for marketing use, but disclose AI-generated marketing images per your local advertising rules — this is a legal, not technical, requirement.

What image formats does the API accept as a reference?
JPEG and PNG, up to 10MB. Larger source files should be downsized before upload; resolution of the output is controlled by the resolution parameter, not the input file size.

Is there a rate limit on reference-guided generation calls?
Yes, scoped per API key — check response headers for your current limit, and use a thread pool with a small max_workers count (3–5) for batch jobs rather than firing all requests simultaneously.


Explore the Nano Banana Pro model page for full parameter docs, or read the AI image editing API guide for more on GPT-image-2's instruction-based edits.

Related posts

Join our DiscordAI Bakery Photography API — Filling and Glaze Variants — GenRelay