Skip to content

modules: markup-guided image edits (--markup) #3785

Closed

Description

@schlessera

Context

OpenAI's edits endpoint accepts a markup annotation layer for GPT Image 2.5 and 2.6: a transparent PNG the same width and height as the first input image. Drawn strokes and notes guide the edit, and additional images are references. It cannot be combined with mask. Limits are 16,777,216 px for the first image and for the layer, and 50 MB for the layer file. There is no extra fee. Source: https://developers.openai.com/api/docs/guides/image-generation, checked 2026-11-09.

The module supports only --mask (ImageRequest.mask, packages/module-images/src/types.ts:30-31; multipart build, packages/module-images/src/providers/openai.ts:287-303).

Blocked by #3782

Scope

  • Add --markup <path> (PNG). It requires at least one --ref, is exclusive with --mask, and routes to OpenAI models that document markup (2.5 and 2.6 pairs).
  • Validate before any provider call: PNG signature, dimensions equal to the first --ref (read from the PNG/JPEG/WebP header), pixel and byte limits.
  • Send it as the multipart markup file on /v1/images/edits.
  • Update help, README, skill and changeset.

Out of scope

The UI's mask-drawing tool (request_image_mask) and any UI for drawing markup. JSON-body edits with image_url/file_id.

Acceptance criteria

  • An offline stub shows --ref a.png --markup m.png posts a multipart markup part to /v1/images/edits on the default model, with no mask part.
  • Markup without --ref, with --mask, not a PNG, of mismatched dimensions, or on Gemini refuses with zero fetch calls.
  • Failing-first receipts and a restored mutation of the dimension check.

Verification

bun run test packages/module-images
bun run typecheck
bun run lint
bun run check:pr --base origin/main

Keyless and offline only.

Contract impact

The --json envelopes are unchanged. This is additive CLI behaviour, shipped as a minor changeset.

Activity

  1. added
    type: featA new capability or a change in user-visible behaviour.
    area: modulesFirst-party content modules and the module seam.
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 9, 2026
  2. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #3782 is closed, so scripts/sync-project.ts is removing the blocked label.

  3. removed
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 10, 2026
  4. self-assigned this
    on Nov 11, 2026
  5. schlessera commented on Nov 11, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-be93c819. Branch: feat/3785-image-markup.

    No path collisions; closure-only overlaps with open PRs touching shared test consumers.

  6. schlessera commented on Nov 11, 2026

    @schlessera
    OwnerAuthor

    The chat UI's markup editor, which would draw these layers, is tracked separately in #3975 (needs design).

  7. added this to the 0.45.0 milestone on Nov 11, 2026
  8. schlessera commented on Nov 11, 2026

    @schlessera
    OwnerAuthor

    Status: the implementation is complete in PR #3972, but it has not merged. Confirmation is blocked by a CI runner outage: the hosted runners cannot resolve the Ubuntu apt mirror (Temporary failure resolving 'azure.archive.ubuntu.com') in the unit jobs' Chrome prerequisites step, so no test runs. The PR comment has the run IDs and evidence.

    Releasing my claim. To resume: once CI's prerequisite step passes again, merge main into the branch and run bun scripts/integrate.ts confirm 3972 --issues schlessera/brain-kit#3785. No code change is expected.

  9. schlessera commented on Nov 12, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-50689fa2. Branch: feat/3785-image-markup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: modulesFirst-party content modules and the module seam.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: featA new capability or a change in user-visible behaviour.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions