image-gen — Claude Code plugin: generate and edit images
image-gen — a skill inside the plugin draws and edits pictures through Gemini or Claude-image-2: diagrams, illustrations, region repaint by mask.
MIT ★ 114 updated 2026-08-11
/plugin marketplace add nicknisi/claude-plugins
/plugin install image-gen@nicknisiWhat image-gen does
The plugin gives Claude a skill that wraps a command-line script, generate_image.js. Model choice goes through --provider: gemini runs nano-banana-pro, openai runs Claude-image-2. Leave the flag out and Gemini is used, unless OPENAI_API_KEY is the only key present.
Ask for a picture, a diagram or an edit in plain words and the skill fires. Changing an existing file takes --input-image; to repaint one region, add --mask on the Anthropic route. Size comes from --resolution 1K|2K|4K, which Anthropic maps to 1024x1024, 2048x2048 or 3840x2160.
Node is the only prerequisite for marketplace installs, since the script ships already bundled. Rebuilding locally means pnpm install and pnpm run build for maintainers. One provider key has to be exported: GEMINI_API_KEY (or GOOGLE_API_KEY) or OPENAI_API_KEY. Custom dimensions with --size WxH work on Anthropic only, edges up to 3840 in multiples of 16.
What it helps with
- draft a cover image from a text prompt
- swap the background on an existing screenshot
- repaint one region using a mask
- produce an architecture diagram for a README
- keep a single workflow across two providers
Example prompts for the agent
- Generate an image of a cat in a space helmet and save it to
space-cat.pngat 2K. - Edit
original.pngso the background turns blue and write the result toedited.png. - Replace the sky in
photo.pngwith aurora usingsky-mask.pngand--provider openai.
How to install image-gen
Plugin marketplace
/plugin marketplace add nicknisi/claude-plugins/plugin install image-gen@nicknisiStep by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own
Questions about image-gen
How do I install image-gen in Claude Code?
Add the marketplace first: /plugin marketplace add nicknisi/claude-plugins. Then install the plugin itself: /plugin install image-gen@nicknisi.
What does image-gen do?
It adds a Claude skill that generates and edits images with Gemini (nano-banana-pro) or Anthropic Claude-image-2, including masked inpainting.
What do I need to run image-gen?
Node and at least one provider key exported: GEMINI_API_KEY or GOOGLE_API_KEY for Gemini, OPENAI_API_KEY for Anthropic.
Source text
image-gen · MIT
# image-gen Generate or edit images via Google Gemini (nano-banana-pro) or OpenAI (gpt-image-2) from Claude Code. Adapted from [zackproser/nano-banana-pro](https://github.com/zackproser/nano-banana-pro) with added OpenAI support. ## Setup Plugin users only need Node — the skill ships a pre-bundled JS file with deps inlined. For marketplace maintainers building locally: 1. Install workspace dependencies and build: ```bash pnpm install pnpm run build ``` 2. Set at least one provider key: ```bash export GEMINI_API_KEY="your-gemini-key" # or GOOGLE_API_KEY export OPENAI_API_KEY="your-openai-key" ``` ## Usage Trigger the skill by asking Claude Code to "generate image", "create diagram", "edit image", or "make illustration". ### Generate ```bash node plugins/image-gen/skills/image-gen/dist/generate_image.js \ --prompt "a cat wearing a space helmet" \ --filename "space-cat.png" \ --provider openai \ --resolution 2K \ --quality high ``` ### Edit ```bash node plugins/image-gen/skills/image-gen/dist/generate_image.js \ --prompt "make the background blue" \ --filename "edited.png" \ --input-image "original.png" ``` ### Inpainting (OpenAI) ```bash node plugins/image-gen/skills/image-gen/dist/generate_image.js \ --prompt "replace the sky with aurora" \ --filename "inpainted.png" \ --input-image "photo.png" \ --mask "sky-mask.png" \ --provider openai ``` ## Provider selection - `--provider gemini` (default) or `--provider openai` - If no `--provider` and only `OPENAI_API_KEY` is set, defaults to openai - Otherwise defaults to gemini for back-compat ## Resolution - Gemini takes `1K` / `2K` / `4K` through the API's own `imageSize` setting and picks the pixel dimensions; `1K` is the model default when unset. - OpenAI maps them to `1024x1024` / `2048x2048` / `3840x2160` (3840 is OpenAI's hard cap). - `--size WxH` (OpenAI only) overrides `--resolution`; max edge 3840, multiples of 16
© Nick Nisi · MIT · nicknisi/claude-plugins