/gemskills:generate-imagefrom gemskills
Generates images from text prompts using OpenAI GPT Image 2.6, Gemini Nano Banana Pro, or xAI Grok Imagine. Handles prompt rewriting, style selection from 167 curated styles, and img2img.
Ships in gemskills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Generate images with OpenAI GPT Image 2.6 (gpt-image-2.6-sunburst finals, gpt-image-2.6-flare drafts), Gemini Nano Banana Pro (gemini-3-pro-image), or xAI Grok Imagine (grok-imagine-image-2.0). Auto-pick prefers OpenAI when OPENAI_API_KEY is set; style tiles and negative prompts route to Gemini.
Use this skill when the user asks to:
If the user hasn't specified a style, present a multi-choice question before proceeding:
How would you like to handle the art style?
- Pick a style - Browse 167 styles visually and choose one
- Let me choose - I'll suggest a style based on your prompt
- What are styles? - Learn how the style system works
- No style - Generate without a specific art style
Use the AskUserQuestion tool to present this choice.
If the user picks "Pick a style", launch the style picker (pick mode is the default):
STYLE_JSON=$(bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/browsing-styles/scripts/preview_server.ts)
The picker opens a browser. The user clicks a style, views the detail modal, clicks "Select This Style". STYLE_JSON receives the selection as JSON and the server exits. Parse the id field and pass it via --style <id> to the generate command.
If the user picks "Let me choose", select the most fitting style based on their prompt and explain why. Use the style suggestions in the "Suggest Styles to Users" section below.
If the user picks "What are styles?", explain: there are 167 curated art styles across 10 categories (traditional, digital, illustration, photography, design, retro, technique, decorative, creative, cultural). Each style includes prompt hints and a visual reference tile that gets sent to Gemini for better adherence. Then re-ask the style question.
If the user already specified a style (e.g. "generate in watercolor style"), skip this step entirely and use --style directly.
Ask clarifying questions before rewriting prompts to understand the user's intent:
Simple requests like "make a cat image" can proceed with sensible defaults. Complex requests like "create a banner for my app" require clarification to avoid iteration waste.
Before generating any image, always rewrite the user's prompt using the guide in references/prompt-guide.md.
The core principle: "Describe the scene, don't just list keywords."
Transform simple prompts by adding:
User says: "banner for my app" Rewritten prompt: "A modern, full-bleed banner for a technology application. Dark gradient background transitioning from deep navy to black. Abstract geometric network visualization with glowing nodes connected by thin lines. Clean sans-serif typography positioned left of center. Professional, tech-forward aesthetic with no visible borders or edges - the design extends seamlessly to all edges. 16:9 aspect ratio."
User says: "a cat" Rewritten prompt: "A fluffy orange tabby cat lounging on a sun-drenched windowsill, soft afternoon light creating a warm glow on its fur. The cat is in a relaxed pose with half-closed eyes, conveying contentment. Shot from a low angle with shallow depth of field, the background showing a blurred garden view. Photorealistic, warm color palette."
Draft → Iterate → Final approach saves time and API costs:
Do not read the image back - the script outputs only the file path. This allows efficient iteration without Claude loading large image data.
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "prompt" [options]
--input <path> - Reference image (can specify multiple times, up to 14 images)--style <id> - Apply style from the style library (see browsing-styles skill)--size <1K|2K|4K|WxH> - Image size (default: model decides). 1K/2K/4K set the pixel budget on every provider. openai also takes an exact WxH, for example 3840x1280.--aspect <ratio> - gemini: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9. openai: any W:H from 1:3 to 3:1 (for example 3:1 for a wide banner). Do not combine with --size WxH.--quality <low|medium|high|xhigh|max|auto> - openai only (default auto). xhigh and max arrived in Image 2.5 and still hold in 2.6. Gemini and xai reject this flag.--negative <prompt> - Negative prompt (what to avoid)--count <n> - Number of images (1-4, default: 1)--guidance <n> - Guidance scale--seed <n> - Random seed for reproducibility--output <path> - Output path--transparent - Transparent/alpha background (OpenAI background=transparent; also Gemini)--provider <name> - gemini, openai, or xai. Omit to auto-pick the best available provider for the request (see Models).--model <id> - OpenAI Image 2.6 variant: sunburst / gpt-image-2.6-sunburst (default, finals) or flare / gpt-image-2.6-flare (fast drafts). Sets provider to openai. Legacy provider aliases gemini|openai|xai|grok still work but are deprecated — use --provider.# Simple generation
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "cyberpunk cityscape at night"
# With art style (100+ available, use short names or full IDs)
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "mountain landscape" --style impressionism
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "portrait" --style ukiy
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "city street" --style noir
# High-res with specific aspect ratio
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "mountain landscape" --size 4K --aspect 16:9
# With negative prompt
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "portrait of a cat" --negative "low quality, blurry"
# Combine style with other options
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "cat sleeping" --style wtrc --size 4K --aspect 1:1
# Generate multiple variations
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "abstract art" --count 4
# Single reference image (img2img)
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "make it look like a watercolor painting" --input photo.jpg
# Multiple reference images (character consistency, scene composition)
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "King on throne in dramatic lighting" \
--input character.png \
--input throne-room.png \
--aspect 16:9 --size 2K
# Multiple characters in a scene
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "Two warriors facing each other in combat" \
--input warrior1.png \
--input warrior2.png \
--input battlefield.png \
--aspect 16:9
Gemini supports up to 14 reference images per request:
| Format | Aspect Ratio | Recommended Size | Crop Target |
|---|---|---|---|
| OG / Social Share | 16:9 | 2K | 1200x630 via sips |
| Twitter Card | 16:9 | 2K | 1200x628 via sips |
| Hero Banner | 16:9 | 4K | Full width |
| Profile Picture | 1:1 | 1K | 512x512 or 1024x1024 |
| Story / Reel | 9:16 | 2K | 1080x1920 |
| Team Lineup | 21:9 | 2K | Full width |
All 4 steps are required. Do not skip optimization.
--size 2K (retina-ready):
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "CENTER all important elements, no content near edges. [your prompt]" --aspect 16:9 --size 2K --output social-share.png
sips -z 630 1200 -c 630 1200 social-share.png --out social-share-og.png # OG
sips -z 628 1200 -c 628 1200 social-share.png --out social-share-tw.png # Twitter
sips -s format jpeg -s formatOptions 85 social-share-og.png --out social-share-og.jpg
sips -g pixelWidth -g pixelHeight social-share-og.jpg
ls -la social-share-og.jpg # Target: <500KB
Why optimize? Gemini outputs PNG (~1-2MB). JPEG at 85% reduces to ~200-400KB with no visible quality loss. Social platforms re-compress uploads, so starting with a well-optimized JPEG prevents double-compression artifacts.
100+ styles across 9 categories: traditional art, digital, illustration, photography, design/UI, retro, techniques, decorative, and creative/material-based.
When a style has a tile reference image (assets/tiles/<id>.png), it is automatically sent as a visual reference to Gemini alongside the prompt hints — this produces much better style adherence.
When generating images, proactively suggest relevant styles:
impr, roma, wtrl, cinebarq, prer, anim, fnoibrut, nbrt, glas, flaty2k, frug, psyc, kodaghbl, kawa, chld, britcybr, nnoi, surr, exprsand, undr, orig, clay, legoBrowse all: bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/browsing-styles/scripts/list_styles.ts --table
Search: bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/browsing-styles/scripts/list_styles.ts --search "watercolor"
Three providers, selected with --provider or auto-picked when omitted.
| Provider | Model | Key | Strengths | Can't do |
|---|---|---|---|---|
gemini (fallback; required for style tiles and negatives) | gemini-3-pro-image (Nano Banana Pro) | GEMINI_API_KEY | Style tiles, up to 14 reference images, dedicated negative prompts, transparency, 1K/2K/4K | — |
openai | gpt-image-2.6-sunburst (Sunburst, default, finals) / gpt-image-2.6-flare (Flare, fast drafts, --model flare) | OPENAI_API_KEY | Best in-image text, lighting/textures, complex instructions, detailed layouts, transparent backgrounds, custom sizes up to 3840px edge and 1:3–3:1 aspect, quality up to max, image-to-image (--input, up to 16, via the edits endpoint) | No style tiles, no dedicated negative param |
xai | grok-imagine-image-2.0 | XAI_API_KEY | Fast, spicier; good when Gemini's filter blocks a benign prompt | Text-to-image only — no img2img/tiles/negative |
--provider is omitted)The script chooses the best provider whose key is present and that supports
what the request needs. Ranking is openai > gemini > xai.
--input (img2img / reference images) is supported by both openai and gemini
— openai routes it through the Image 2.6 edits endpoint, gemini through Nano
Banana Pro (which also supports style tiles + up to 14 refs). So img2img
auto-picks openai when its key is present; pass --provider gemini for Gemini's
style-tile / multi-ref compositing.
--transparent is supported by openai and gemini (OpenAI passes
background=transparent). Capability gating still forces Gemini when the
request uses --style (style tiles) or --negative (a dedicated negative
parameter) — only Gemini supports those. Pin a default with /gemskills:setup
or GEMSKILLS_IMAGE_PROVIDER.
When openai is chosen with a --style, the style tile image is dropped (the
textual hints are still applied) and --negative is folded into the prompt as an
Avoid: … clause. xAI additionally drops reference images (text-to-image only).
Each provider parses prompts differently. After the provider is resolved, read the matching guide and rewrite the prompt to it:
providers/prompts/image.gemini.mdproviders/prompts/image.openai.mdproviders/prompts/image.xai.md# Force a provider / Image 2.6 variant
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "neon city street, rain" --provider openai --size 4K --quality high
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "panoramic website footer city" --model sunburst --aspect 3:1 --size 4K # 3840x1280
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "app icon, rounded square" --model sunburst --transparent
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-image/scripts/generate.ts "watercolor fox" --provider xai
The API accepts auto or WIDTHxHEIGHT where both edges are divisible by 16, the aspect is 1:3 to 3:1, the max edge is 3840, and total pixels are 655,360 to 8,294,400. The script computes a valid size from --size tier + --aspect, and stops with an error for any size the API would reject. It never changes an invalid size to auto. Sizes above 2560x1440 are experimental per OpenAI. input_fidelity is not supported by Image 2.6 and is never sent.
Cost is printed from the response usage with the published per-token prices (text input $5, image input $8, image output $30 per 1M tokens). Models without a price entry print "no price data".
Models verified live: 2026-11-07 (
gpt-image-2.6-sunburst,gpt-image-2.6-flare,grok-imagine-image-2.0).gemini-3-pro-imageis by docs only (Gemini key rejected); Google's docs also listgemini-nano-banana-2.1(Flash tier) — not yet adopted. If a newer generation exists, STOP and suggest a PR tob-open-io/gemskills.
For detailed prompting strategies and techniques:
references/prompt-guide.md - Comprehensive Gemini prompting guide with 7 strategies, example transformations, and best practices from Google's official documentationreferences/gemini-api.md - Current Gemini models, SDK info, and dynamic documentation via llms.txtWhat SKILL.md sets; muted values are Claude Code's defaults
19 skills in this plugin
/ask-geminiThis skill should be used when the user asks to "ask Gemini", "get Gemini's opinion", "have Gemini review", "improve writing style", "make less AI-sounding", "get feedback on article", "review this draft", "Nano Banana", "Gemini API help", "Gemini models", or needs a second opinion on content, writing, code, or design. Supports text questions and up to 10 images./avatar-portraitThis skill should be used when the user asks to "create an avatar from a photo", "generate a portrait avatar", "make a profile image", "convert headshot to styled portrait", "team member avatar", "character-style avatar", or needs likeness-preserving avatars in any style (including pixel art)./browsing-stylesThis skill should be used when the user asks to "browse art styles", "pick a style", "choose a style", "select a style", "list available styles", "search styles", "show style options", "what styles are available", "explore artistic styles", "open style browser", "style picker", or needs to see available styles for image generation. Launch the visual browser (browse.ts) when the user wants to interactively pick a style.gemskills@b-open-io is listed by b-open-io/claude-plugins — review the source before installing
npx claudepluginhub b-open-io/claude-plugins --plugin gemskillsOther plugins' skills for the same job