AI Cosmetics Photography API — Shade and Packaging Variants
A makeup brand is releasing a twelve-shade lipstick range in one matte black tube. Only the bullet color and the label sticker change between shades, yet the product page needs a clean packshot for every one. The studio photographed the first shade; the remaining eleven are still waiting on production samples, and the retailer's listing deadline arrives first. Generating the other shades from the one reference photo lets the page carry the full range while the physical samples catch up.
Direct answer: a reference-guided image generation API takes one cosmetics photo as image input plus a prompt describing the target shade, case finish, or label tone, and returns a new image that keeps the tube or compact silhouette consistent while changing only the requested elements.
How Does an API Generate Shade Variants From One Photo?
Reference-guided generation anchors the output to the geometry of the source image, then applies the change in the prompt. Reference-guided generation means the model receives an existing image as input alongside the text prompt, rather than starting from text alone. For cosmetics, that anchoring keeps the tube proportions, cap seam, and bullet angle of the real product, where a text-only prompt would invent a generic lipstick that does not match the SKU.
Color is the sensitive part. Name the shade in visual terms ("muted brick red, satin finish, slight highlight along the bullet's angled tip") rather than a marketing name like "Heritage 07", which the model cannot map to a color.
Can the Generated Shade Be Trusted as Color-Accurate?
No, treat generated shades as a visual placeholder, not a color-matched swatch. Model output can drift in hue and saturation, and shoppers buy cosmetics largely on color, so a listing that shows a different shade than the shipped product invites returns.
Two practical rules:
- Use generated images for the lineup grid, internal review, and pre-launch pages, and swap in real photography once samples exist.
- Compare each generated image with the physical or lab-approved color reference before it reaches a customer-facing page.
Which Model Fits Cosmetics Photography?
Nano Banana Pro's reference-guided mode holds the case geometry and cap shape consistent across shade and finish changes, which matters when shoppers compare shades side by side in a grid. GPT-image-2 suits instruction-based touch-ups on an image that is otherwise final, such as a background swap or a smudge cleanup.
| Model | Mode | Resolution / price | Geometry consistency | Best for |
|---|---|---|---|---|
| Nano Banana Pro | Reference-guided | 1K $0.030 / 2K $0.030 / 4K $0.042 | High | Full shade-range sets from one base studio photo |
| Nano Banana 2 | Reference-guided | 1K $0.020 / 4K $0.036 | Medium-high | Lower-cost drafts for internal color review |
| GPT-image-2 | Instruction-based edit | $0.014/image | N/A (edits existing photo) | Background swap or cleanup on a near-final shot |
Nano Banana Pro at 2K costs the same $0.030 as 1K, so a retail-facing set gains resolution at no extra cost.
How Do I Generate a Shade Variant via API?
Submit the base photo as image input with a prompt describing the target shade and 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, shade, finish):
r = requests.post(
f"{BASE}/images/generations",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"model": "nano-banana-pro",
"prompt": f"same matte black lipstick tube shape and proportions, "
f"{shade} bullet, {finish} finish, plain label area, "
f"soft highlight on the bullet tip, studio product shot, "
f"pale neutral background",
"image": reference_url,
"resolution": "2k",
},
)
return r.json()["id"]
job_id = generate_variant(
"https://cdn.example.com/lipstick-sample.jpg",
"muted brick red",
"satin",
)
Reference-guided generation is asynchronous, so poll the job until it completes:
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 Shade Range?
Loop over the shade list and submit each as its own job. The batch image generation guide covers the concurrency and retry pattern this scales to.
shades = [
("muted brick red", "satin"),
("dusty rose", "matte"),
("deep berry", "satin"),
("warm nude beige", "matte"),
]
jobs = [(shade, generate_variant(reference_url, shade, finish))
for shade, finish in shades]
for shade, job in jobs:
print(f"{shade}: {wait_for_result(job)}")
What Does a Full Shade Range Cost?
Twelve shades at 2K on Nano Banana Pro cost 12 × $0.030 = $0.36. A brand with the same range across a lipstick, a gloss, and a compact (36 images) pays 36 × $0.030 = $1.08.
| Launch size | Images | Model | Cost |
|---|---|---|---|
| One tube, 12 shades | 12 | Nano Banana Pro, 2K | $0.36 |
| Three formats, 12 shades each | 36 | Nano Banana Pro, 2K | $1.08 |
| Internal color review pass | 12 | Nano Banana 2, 1K | $0.24 |
Running the internal review on Nano Banana 2 first keeps early color decisions inexpensive, and only the approved set moves to Nano Banana Pro. Once stills are approved, the same photos can feed the cosmetics showcase video guide for twist-up and swatch clips.
FAQ
Can the API change the shade without changing the case?
Yes. Describe the target color and state that the tube shape and proportions stay the same; the reference image keeps the geometry anchored.
Will the model reproduce my logo and label text?
Not reliably at small sizes. Request a plain label area and composite the real logo and ingredient text afterward.
Can I use the output for a retail listing?
That is a decision for your own brand and retailer guidelines. Many marketplaces require images to match the shipped item, so verify each shade against the real product before publishing.
How long does a generation take?
Jobs are asynchronous. The polling loop above uses a 90-second timeout, which is a conservative ceiling rather than a typical time.
See the Nano Banana Pro model page for parameter docs.