Skip to content

[codex] Update imagegen system skill#18852

Merged
won-openai merged 5 commits intomainfrom
vb/imagegen-system-skill
Apr 22, 2026
Merged

[codex] Update imagegen system skill#18852
won-openai merged 5 commits intomainfrom
vb/imagegen-system-skill

Conversation

@vb-openai
Copy link
Copy Markdown
Contributor

@vb-openai vb-openai commented Apr 21, 2026

Summary

Updates the embedded imagegen system skill with the latest gpt-image-2 routing, CLI, and documentation guidance.

The skill now keeps normal image generation/editing on the built-in image_gen path, makes gpt-image-2 the default CLI fallback model, and treats simple transparent-image requests as built-in-first: generate on a flat chroma-key background, then remove the key locally with scripts/remove_chroma_key.py to produce an alpha PNG/WebP.

True/native transparency is now a separate confirmed fallback path. CLI gpt-image-1.5 --background transparent --output-format png is reserved for explicit native-transparency asks, subjects too complex for chroma-key removal, or failed local alpha validation, because gpt-image-2 does not support background=transparent.

Details

  • Update SKILL.md routing guidance for built-in vs CLI fallback behavior.
  • Keep “batch” requests on the built-in path unless the user explicitly asks for CLI/API/model controls.
  • Add the built-in-first transparent workflow:
    • choose a subject-safe chroma-key color
    • prompt for one perfectly flat solid background
    • prohibit that key color inside the subject
    • run scripts/remove_chroma_key.py --auto-key border
    • validate alpha output before using it
  • Add scripts/remove_chroma_key.py for chroma-key alpha extraction, soft matte, despill, edge contraction, and PNG/WebP output.
  • Clarify that CLI gpt-image-1.5 native transparency requires user confirmation unless explicitly requested.
  • Update CLI/API docs for gpt-image-2:
    • default CLI fallback model
    • flexible size validation
    • 3840x2160 / 2160x3840 4K guidance
    • quality values including auto
    • unsupported background=transparent
    • unsupported input_fidelity
  • Update prompt/reference docs and sample prompts with the new transparent-image workflow.

Validation

  • cargo test -p codex-skills
  • git diff --check
  • Manual CLI dry-runs for:
    • default gpt-image-2 payload
    • 4K size acceptance
    • invalid size rejection
    • transparent background rejection on gpt-image-2
    • transparent background acceptance on gpt-image-1.5
    • input_fidelity rejection on gpt-image-2
    • chroma-key removal workflow

@vb-openai vb-openai marked this pull request as ready for review April 21, 2026 15:46
@vb-openai vb-openai changed the title [codex] Update imagegen system skill for gpt-image-2 [codex] Update imagegen system skill Apr 21, 2026
Comment thread codex-rs/skills/src/assets/samples/imagegen/references/cli.md
@won-openai won-openai enabled auto-merge (squash) April 21, 2026 19:34
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@gabrielchua-oai
Copy link
Copy Markdown

I have read the CLA Document and I hereby sign the CLA

@gabrielchua-oai
Copy link
Copy Markdown

recheck

github-actions Bot added a commit that referenced this pull request Apr 22, 2026
@gabrielchua-oai
Copy link
Copy Markdown

@codex review

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13dba916a1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/skills/src/assets/samples/imagegen/scripts/remove_chroma_key.py Outdated
Comment thread codex-rs/skills/src/assets/samples/imagegen/SKILL.md Outdated
@won-openai won-openai merged commit 0ebe69a into main Apr 22, 2026
25 checks passed
@won-openai won-openai deleted the vb/imagegen-system-skill branch April 22, 2026 15:08
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants