DEV Community

Cover image for GPT Image 2.6: Build a Preservation Contract for Precise Image Edits
Germey
Germey

Posted on Edited on

GPT Image 2.6: Build a Preservation Contract for Precise Image Edits

A team reviewing multiple visual drafts

GPT Image 2.6 makes generation faster and editing more controllable, but a production image workflow still needs something a prompt alone cannot provide: a testable definition of what must not change.

Consider a product image whose background must become warm stone. The bottle silhouette, label position, camera angle, and shadow direction are already approved. “Replace the background” is underspecified; even a visually attractive result can be a regression if the label drifts.

This article shows a two-stage workflow: use Flare for cheap, fast exploration, then use Sunburst for the controlled edit. The important addition is a preservation contract that turns subjective review into an explicit acceptance step.

Disclosure: This article was prepared for an Ace Data Cloud promotional task and adapted from Ace Data Cloud's public product materials and API documentation, with AI assistance. The author is not presenting this as an independent customer benchmark or a personally executed test. The code below is an unexecuted integration example; validate it in your own environment.

1. Separate exploration from delivery

The two GPT Image 2.6 variants serve different points in the workflow:

  • gpt-image-2.6-flare is the practical choice for quickly exploring composition, palette, and layout.
  • gpt-image-2.6-sunburst is better suited to final-quality work and edits where consistency matters more.

Do not send every idea through the highest-quality path. Generate a small contact sheet or a few low-quality candidates with Flare, let a person choose a direction, and only then edit the approved asset with Sunburst. This reduces wasted high-quality work and creates a stable input for review.

The current generation documentation and editing documentation expose separate endpoints. That boundary is useful: generation creates candidates; editing changes an identified asset.

2. Define a preservation contract

Store edit intent next to the source asset rather than burying it in a chat transcript:

{
  "asset_id": "product-hero-v12",
  "source_url": "https://cdn.example.com/product-hero-v12.png",
  "change": "Replace only the background with warm white stone",
  "preserve": [
    "bottle silhouette",
    "label position and readable text",
    "camera angle",
    "object scale and placement",
    "shadow direction"
  ],
  "reject_if": [
    "label text is rewritten",
    "product geometry changes",
    "new objects appear"
  ]
}
Enter fullscreen mode Exit fullscreen mode

This contract has three jobs. It produces a precise prompt, gives reviewers the same checklist, and records why a result was rejected. It also discourages the misleading expectation that generative editing behaves like a pixel-locked layer operation. Unrelated details can still move, so preservation must be verified.

3. Validate before calling the API

The JSON editing endpoint accepts an image URL (or an array of URLs), while direct file upload uses multipart form data. Validate the boundary in your own application:

function validateEdit(job) {
  if (!job.source_url?.startsWith("https://")) {
    throw new Error("source_url must be HTTPS");
  }
  if (!job.change || job.change.length > 2000) {
    throw new Error("change must contain 1–2000 characters");
  }
  if (!Array.isArray(job.preserve) || job.preserve.length === 0) {
    throw new Error("at least one preservation rule is required");
  }
}

function buildPrompt(job) {
  return [
    `CHANGE: ${job.change}.`,
    `PRESERVE: ${job.preserve.join("; ")}.`,
    `REJECT CONDITIONS: ${job.reject_if.join("; ")}.`,
    "Do not redesign or restyle preserved elements."
  ].join("\n");
}
Enter fullscreen mode Exit fullscreen mode

Also enforce an allowlist for models, output formats, and source hosts. If users supply URLs, defend against SSRF by resolving or proxying inputs through controlled storage rather than allowing arbitrary internal addresses.

4. Submit the controlled edit

The following is an unexecuted example using a placeholder credential:

curl --request POST \
  --url https://api.acedata.cloud/openai/images/edits \
  --header "Authorization: Bearer YOUR_ACE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "gpt-image-2.6-sunburst",
    "image": "https://cdn.example.com/product-hero-v12.png",
    "prompt": "CHANGE: Replace only the background with warm white stone. PRESERVE: bottle silhouette; label position and readable text; camera angle; object scale and placement; shadow direction. Do not redesign preserved elements.",
    "quality": "high",
    "size": "1024x1024",
    "output_format": "png",
    "response_format": "url",
    "n": 1
  }'
Enter fullscreen mode Exit fullscreen mode

A URL response is convenient for review, but do not treat a provider URL as permanent storage. Copy the result to object storage, compute a checksum, and save the request parameters, source asset version, output URL, and review state in one record.

5. Make acceptance explicit

Automation can catch structural failures; a human should approve semantic fidelity.

Automatic checks can verify:

  • HTTP status and expected response shape
  • downloadable, decodable output
  • MIME type and dimensions
  • non-empty file and stable checksum
  • retry policy for 429 and transient 5xx responses

Human checks should use the preservation contract:

  • Is the label text unchanged and readable?
  • Did the silhouette or product proportions drift?
  • Are camera angle, placement, and shadow direction preserved?
  • Did the requested background change actually happen?

Record each item as pass, fail, or needs_review. On failure, do not overwrite the approved source. Create a new edit attempt with the rejected output, reason, and revised prompt attached. Idempotency on your side—one business job ID mapped to one accepted result—also prevents a timeout from creating duplicate deliverables.

What about native GIF?

GPT Image 2.6 Flare and Sunburst support gif as a native output format according to the current API documentation. That opens a useful extension: establish a character in a static image, then request several lightweight animated reactions while preserving face, clothing, palette, and proportions. Ace Data Cloud's sticker workflow illustrates that direction.

Treat GIF acceptance as a separate contract: verify frame count, duration, looping behavior, file size, transparency, and character consistency. Static-image resolutions—including supported 4K presets—must not be presented as “4K GIF” capability. If the asset will be submitted to a messaging platform, check that platform's current rules at submission time; generation does not imply review approval or publication.

For manual exploration before writing code, use Ace Data Cloud Studio. For an API integration, keep the workflow disciplined: explore with Flare, deliver with Sunburst, preserve approved details through a written contract, and never mark an edit complete until the output passes both structural checks and human review.

Sources

Top comments (0)