AI Eyewear Photography API — Sunglasses & Glasses Variants
An eyewear brand launching a frame in six colorways and three lens tints has one studio photo of the sample pair, but the storefront needs a clean product shot for every frame-lens combination before launch day. Re-shooting eighteen combinations of the same frame — swapping acetate color and lens tint while keeping the angle, reflection, and hinge detail identical — turns a single-frame photoshoot into a multi-day studio booking. Generating each combination from the one reference photo removes the reshoot and keeps every listing on the same lighting setup by construction.
Direct answer: a reference-guided image generation API takes one eyewear product photo as image input plus a prompt describing the target frame color and lens tint, and outputs a new image that holds the frame shape, hinge, and temple proportions consistent while altering only the requested attributes — no separate photo shoot per combination.
How Does an API Generate Frame Color and Lens Tint Variants From One Photo?
Reference-guided generation anchors the output to the shape, bridge width, and temple geometry of the source image, then applies the color and tint change described in the prompt. This differs from text-to-image generation, which has no source object to match and would produce a plausible-looking pair of glasses rather than the exact frame shipping to retailers.
Lens tint is a distinct attribute from frame color and needs its own description in the prompt — naming the tint explicitly ("gradient gray lens", "solid amber lens", "clear prescription lens") keeps the model from defaulting every variant to the same lens finish as the reference photo while only the frame acetate changes color.
Which Model Fits Eyewear Product Photography?
Nano Banana Pro's reference-guided mode holds bridge width, hinge placement, and temple curve consistent across frame and lens changes, which matters for eyewear because a subtly widened bridge or shifted hinge reads as a fit problem rather than a rendering artifact on a product category where millimeter proportions are part of the sale. GPT-image-2 fits smaller instruction-based touch-ups — background swap, reflection cleanup, or crop — on a photo that's otherwise already final.
| Model | Mode | Resolution / price | Shape consistency | Best for |
|---|---|---|---|---|
| Nano Banana Pro | Reference-guided | 1K $0.030 / 2K $0.030 / 4K $0.042 | High | Full frame-and-lens combination sets from one base studio 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 lens-reflection cleanup on a near-final shot |
For a full colorway-and-tint launch, Nano Banana Pro's consistency at 2K resolution is worth the small premium over Nano Banana 2 — a warped temple or mismatched lens gradient reads as a defect to a shopper comparing frame options side by side, not a rendering quirk.
How Do I Generate an Eyewear Variant via API?
Submit the base product photo as image input with a prompt describing the target frame color and lens tint; 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, frame_color, lens_tint):
r = requests.post(
f"{BASE}/images/generations",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"model": "nano-banana-pro",
"prompt": f"same frame shape and hinge geometry, "
f"{frame_color} acetate frame, {lens_tint} lens, "
f"studio product shot, 45-degree angle, white background",
"image": reference_url,
"resolution": "2k",
},
)
return r.json()["id"]
job_id = generate_variant(
"https://cdn.example.com/frame-sample.jpg",
"tortoiseshell brown",
"gradient gray",
)
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 Launch — Every Frame Color × Lens Tint?
Loop over the color and tint combinations 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.
frame_colors = ["black", "tortoiseshell brown", "crystal clear", "matte olive"]
lens_tints = ["solid gray", "gradient gray", "amber"]
jobs = []
for color in frame_colors:
for tint in lens_tints:
job_id = generate_variant(reference_url, color, tint)
jobs.append((color, tint, job_id))
results = [(c, t, wait_for_result(j)) for c, t, j in jobs]
for color, tint, url in results:
print(f"{color} / {tint}: {url}")
What Does a Full Launch Cost?
Twelve frame-and-tint combinations at 2K resolution on Nano Banana Pro cost 12 × $0.030 = $0.36. A wider eighteen-combination launch across six colorways and three tints costs 18 × $0.030 = $0.54.
| Launch size | Combinations | Model | Cost |
|---|---|---|---|
| Small collection | 12 (4 colors × 3 tints) | Nano Banana Pro, 2K | $0.36 |
| Full collection | 18 (6 colors × 3 tints) | Nano Banana Pro, 2K | $0.54 |
| Internal review pass | 18 | Nano Banana 2, 1K | $0.36 |
Running an internal review pass on Nano Banana 2 before committing the final set to Nano Banana Pro keeps merchandising review cheap without touching the launch-quality model until the combination list is finalized.
Internal Links
FAQ
Can the API change lens tint without also changing the frame color?
Yes — describe only the lens tint change in the prompt and instruct the frame color to stay the same as the reference photo; the two attributes are independent in the prompt even though both come from the same reference image.
Does it handle reflective or mirrored lens finishes accurately?
It approximates reflective and mirrored finishes based on the tint description; naming the finish explicitly ("mirrored blue lens" vs. "solid gray lens") keeps the model from defaulting to a flat, non-reflective tint.
Can one API call generate a frontal and a 45-degree angle shot together?
No — each angle requires its own reference photo as input. Generate the angle you need per reference photo rather than expecting multiple viewpoints from a single call.
What resolution is needed for a zoomable lens-detail product page?
2K covers most storefront zoom interactions; 4K adds a $0.012 premium per image and is worth it mainly for lens-detail close-ups or print catalogs.
Is there a free tier to test frame-and-tint consistency before a full launch?
Yes. GenRelay includes free credits on signup, enough to generate a handful of combinations from one reference photo before committing to a full collection batch.
As of September 2026. Pricing subject to change — verify current rates at genrelay.ai.