
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
opencode-gpt-imagegen
Advanced tools
OpenCode plugin for GPT Image 2 generation through your ChatGPT subscription, with reference images and safe PNG output.

Bring ChatGPT Images 2.0 (
gpt-image-2) to OpenCode. Use it through your ChatGPT subscription (no API costs!) or through the OpenAI API — your call.
| Auth path | Status | Billing |
|---|---|---|
| ChatGPT subscription (OAuth) | Available now in v0.1.0 | No extra cost — comes out of your existing Plus / Pro / Business plan |
| OpenAI API key | Coming soon in v0.2.0 | Pay-per-image against your API credits, with generate + edit support |
Add this plugin to your OpenCode config. For example, in opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-gpt-imagegen"]
}
OpenCode auto-installs the package via Bun on next launch — no separate npm install step is needed. The plugin requires OpenCode to be authenticated with ChatGPT.
Just ask your agent in natural language and gpt_imagegen will be picked up.
The three examples below are the actual outputs of this repo's e2e test suite — see tests/e2e.test.ts for the exact prompts and assertions.
Draw a man in a navy samue with a red hachimaki, standing in a garden full of cherry blossoms. 90s anime style. Save it as
character.png, portrait 1024x1536.

gpt_imagegen never overwrites an existing file: when the out path is already taken, it picks -v2, -v3, … instead.
Now do the same path but make it a woman in a yellow yukata holding a red wagasa, in a moonlit garden with fireflies. Landscape 1536x1024.
The previous character.png is left untouched; the new image lands at character-v2.png.

Pass any number of image paths via the images argument and the model uses them as references for the next generation — for style guidance, characters to keep, scenes to extend, and so on.
Take
character.pngandcharacter-v2.pngand put both characters together on the engawa of an old Japanese house, smiling at the viewer. 2048x1152, same 90s anime style.

| Version | Auth path | Scope | Status |
|---|---|---|---|
| v0.1.0 | ChatGPT subscription | gpt_imagegen with optional reference images (generation + reference-guided edits via prompting) | Released |
| v0.2.0 | OpenAI API key | Adds the API-key billing path: both generate (/v1/images/generations) and edit (/v1/images/edits) with reference images | Next |
| v0.3.0 | OpenAI API key | Adds pixel-precise mask inpainting via /v1/images/edits (binary PNG alpha mask) | Planned |
OpenCode already talks to the OpenAI Codex backend to power ChatGPT subscription chat. This plugin reuses that same endpoint, attaching the hosted image_generation tool to a single-turn request, then writes the returned PNG to disk. Auth is read from OpenCode's standard auth.json; no new credential surface is introduced.
This is an unofficial, third-party plugin, not affiliated with or endorsed by OpenAI or OpenCode.
It uses the same Codex backend endpoint OpenCode itself calls for ChatGPT subscription chat — this plugin just adds the hosted image_generation tool to that conversation. Use must comply with OpenAI's Terms of Use and Usage Policies.
FAQs
OpenCode plugin for GPT Image 2 generation through your ChatGPT subscription, with reference images and safe PNG output.
The npm package opencode-gpt-imagegen receives a total of 83 weekly downloads. As such, opencode-gpt-imagegen popularity was classified as not popular.
We found that opencode-gpt-imagegen demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.