Skip to content

modules: generate animated GIFs with GPT Image 2.6 (--format gif, --frames, --frame-duration) #3783

Closed

Description

@schlessera

Context

brain image only accepts --format png|jpeg|webp (FORMATS, packages/module-images/src/cli.ts:35; ImageRequest.format, packages/module-images/src/types.ts:25). GPT Image 2.6 can return an animated GIF: output_format: "gif" on POST /v1/images/generations and /v1/images/edits, with frame_count 2–16 (default 9) and frame_duration_ms 20–2000 (default 200, rounded to 10 ms). Sources are in #3781 and were checked 2026-11-09. The API reference says GIF needs "GIF preview access for the model". GIF output has no streaming, partial images, custom compression or masks. The guide does not say whether background: "transparent" applies to GIF; transparency is documented for png/webp only.

Blocked by #3782

Scope

  • Add --format gif, served only by the 2.6 pair (a capability flag on the model, used by routing).
  • Add --frames <2-16> and --frame-duration <ms 20-2000>, valid only with --format gif. Validate them before routing and send them as frame_count and frame_duration_ms. When omitted, send nothing and let the API apply its documented defaults (9 frames, 200 ms).
  • Refuse before any provider call: GIF with --mask, with --transparent (undocumented for GIF), on Gemini or the 2.5 models, and frame flags without --format gif.
  • Write the file as .gif with mime image/gif. The result reports the actual format.
  • An OpenAI refusal for missing GIF preview access is shown with a hint that names the access requirement and is not marked retryable.
  • Dry-run cost for GIF stays unknown (null). The calculator does not document per-frame token counts.
  • Update help, README, skill and changeset.

Out of scope

Streaming. Converting GIF to video. Inspecting or validating frames after download. Raising the frame limit above 16 unless the API reference changes. GIF reference-image input.

Acceptance criteria

  • Offline stubs show brain image "x" --format gif --frames 12 --frame-duration 150 sends output_format:"gif", frame_count:12 and frame_duration_ms:150 to the default 2.6 model, plus Epic: image generation runs on GPT Image 2.6 and uses its complexity, GIF, SVG and markup features #3781's quality and complexity defaults. The bytes are written to a .gif path. The multipart edit with --ref carries the same fields.
  • --frames 1, --frames 17, --frame-duration 10, --frame-duration 2001, and frame flags without --format gif refuse with zero fetch calls and name the valid range.
  • GIF with --mask, --transparent, --provider gemini or --model gpt-image-2.5-sunburst refuses with zero fetch calls and an actionable reason.
  • A dry run reports estimatedCostUsd: null for GIF.
  • Failing-first receipts and a restored mutation of the frame-range guard.

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; output simply ends in .gif. The new flags are additive CLI behaviour, shipped as a minor changeset for @schlessera/brain-module-images.

Activity

  1. added this to the 0.45.0 milestone on Nov 9, 2026
  2. added
    type: featA new capability or a change in user-visible behaviour.
    area: modulesFirst-party content modules and the module seam.
    priority: p1Scheduled into the current or next milestone.
    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
  3. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

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

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

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-1dcbef18. Branch: feat/3783-image-gif.

    none blocking (collision report checked before claim)

  7. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Status: implemented in #3868 (head 18c3bad102f54db11dbdc9282099e06216466018, draft, milestone 0.45.0); not merged yet.

    Every acceptance criterion is covered by offline tests in packages/module-images (194 pass, 0 fail). Typecheck, lint and check:pr pass. The failing-first receipt and the frame-range mutation are in the PR body.

    Blocker: main has been red since b77987afb (#3884, claimed by another orchestrator). Proof for non-fix PRs is paused until bun scripts/integrate.ts main-status --json reports green.

    To resume, once main is green:

    1. Merge origin/main into feat/3783-image-gif and push. The PR's own files need no change unless main touched packages/module-images/.
    2. Edit the PR body once to start the contract run for the new head, and wait for it to pass.
    3. bun scripts/integrate.ts confirm 3868 --issues schlessera/brain-kit#3783 (exit 2 with "merged":true means it merged).

    Releasing my claim so the issue is not held while main is red.

  8. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-55b59d95. Branch: feat/3783-image-gif.

    resuming PR 3868 after main returned green

  9. schlessera commented on Nov 11, 2026

    @schlessera
    OwnerAuthor

    Delivered by #3868, squashed onto main as a875fa5f910c68df7dde92546ef09df0ea204ec4 (milestone 0.45.0). Every acceptance criterion is covered by offline tests in packages/module-images; the failing-first receipt and the frame-range mutation are in the PR body. The hint for missing GIF preview access matches inferred wording, since no live call was made.

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: p1Scheduled into the current or next milestone.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