GPT Image 2.6 is most useful when you stop treating every revision as a new generation. A production image workflow should separate exploration from controlled editing, then verify that the edit changed only what was requested.
This tutorial builds that pattern around a product hero image. Stage one uses GPT Image 2.6 Flare to explore a composition. Stage two uses GPT Image 2.6 Sunburst to revise an approved candidate while preserving the product, label, camera angle, and lighting. The final gate turns those preservation requirements into explicit acceptance checks.
Disclosure: This article was prepared for an Ace Data Cloud promotional campaign and is based on Ace Data Cloud's public product article and API documentation. AI assisted with drafting and editing. The requests below are illustrative examples and were not executed as part of this article.
Why split generation from editing?
A single “make the final image” prompt combines two different jobs:
- Exploration: find a useful composition, palette, and visual direction.
- Revision: make one bounded change without damaging approved details.
Using the highest-fidelity path for every exploratory attempt increases latency and resource use. Conversely, regenerating after approval risks changing text, proportions, or identity. A practical division of labor is to use Flare for quick candidate generation and Sunburst when detail retention and editing consistency matter more.
That is a workflow choice, not a guarantee: outputs still need review, and performance varies with prompt, size, quality, and service conditions.
Stage 1: validate, then generate a candidate
The public Images Generations documentation defines a POST /openai/images/generations endpoint with required model and prompt fields. GPT Image 2.6 accepts explicit WIDTHxHEIGHT values; passing dimensions is safer than asking downstream code to infer a canvas.
# Example only: replace the placeholder token before running.
curl --fail-with-body https://api.acedata.cloud/openai/images/generations \
-H "Authorization: Bearer YOUR_ACE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-flare",
"prompt": "Studio product hero image of a cobalt-blue insulated bottle on a pale stone tabletop, soft window light, label facing camera, no extra text",
"size": "1536x1024",
"quality": "low",
"output_format": "png",
"response_format": "url"
}'
Validate before sending the request:
- allow-list model IDs rather than accepting arbitrary user input;
- require a non-empty prompt and cap its length at your application boundary;
- parse
sizeas two integers and enforce your supported aspect ratios; - allow-list
png,jpeg,webp, and—only for GPT Image 2.6—gif; - reject contradictory choices, such as a transparent background with JPEG.
The synchronous success shape can contain data[].url; asynchronous requests can instead return a task_id. Do not put both shapes into one loosely typed “result” object. Model them as a tagged union such as {kind: "complete", urls: [...]} or {kind: "pending", taskId: "..."}.
Download accepted results into your own object storage. Remote result URLs are delivery locations, not a durable asset database. Store the prompt, model, size, quality, response trace identifier when available, content hash, and parent asset ID beside each file.
Stage 2: edit with a preservation contract
Suppose reviewers approve the bottle but want a warmer tabletop. Send the approved asset to the Images Edits endpoint and state both the intended change and the invariants.
# Example only. approved-v1.png is a local file selected after review.
curl --fail-with-body https://api.acedata.cloud/openai/images/edits \
-H "Authorization: Bearer YOUR_ACE_API_TOKEN" \
-F "model=gpt-image-2.6-sunburst" \
-F "image=@approved-v1.png" \
-F "prompt=Change only the tabletop from pale stone to warm light oak. Preserve the bottle geometry, cobalt color, label text and placement, camera angle, shadows, reflections, crop, and background." \
-F "size=1536x1024" \
-F "quality=high" \
-F "output_format=png" \
-F "response_format=url"
The edit API also supports JSON with image URLs, while direct file bytes use multipart/form-data. Keep those client paths separate so a URL is never accidentally treated as uploaded binary data.
A mask can narrow the editable region further, but it creates another validation surface: check file type, dimensions, and alpha semantics before submission. A mask is not a substitute for a preservation prompt; use both when an edit must stay spatially constrained.
Turn “looks right” into an acceptance gate
Before promoting the edit to approved-v2, run checks in three groups:
Mechanical checks
- HTTP status is successful and the response matches the expected sync or async schema.
- The downloaded file's detected MIME type matches the requested format.
- Pixel dimensions equal
1536x1024. - The file hash is new, and the asset is stored before the job is marked complete.
Preservation checks
- bottle silhouette and position match the approved source;
- label text, placement, and legibility are unchanged;
- crop, camera angle, highlights, and shadows remain stable;
- only the tabletop material changed.
Human checks
- no malformed typography, duplicated edges, or implausible reflections;
- the result still satisfies brand and content policy;
- a reviewer explicitly approves the new version.
Automated similarity metrics can flag large drift, but they cannot prove that a logo or label is correct. Keep the source and candidate side by side and record each invariant as pass, fail, or not applicable.
Handle failures without duplicating work
Treat 400 as a request defect: log the structured error, fix validation, and do not retry unchanged. Stop on 401 or 403; credentials, access, moderation, or policy require intervention. For 429, honor server guidance and retry with exponential backoff plus jitter. Retry 500 or 504 only with a bounded policy.
If a write times out after submission, the outcome may be unknown. Query the task or your job store before creating another request. Use an application idempotency key if your surrounding system supports one, and keep a unique mapping from your job ID to the provider task ID. This prevents a worker restart from silently generating and charging for duplicate assets.
For manual exploration before integration, the same workflow can be tried in Ace Data Cloud Studio. In production, the important upgrade is not merely a newer model: it is the combination of explicit stages, durable provenance, preservation criteria, and failure-aware orchestration.
Top comments (0)