Generate AI images using Gemini or GPT APIs directly. Covers model selection (Gemini for scenes; GPT Image 2 for text rendering, batch variations, multi-reference compositing; GPT Image 1.5 for transparent icons), the 5-part prompting framework, API calling patterns, multi-turn
Installs just this skill. Get the whole plugin for auto-invocation.
โก How it fires
How this skill gets triggered: by you, by Claude, or both.
Fires itselfClaude auto-loads it when your prompt matches the work.
You can call itInvoke it directly when you want it.
Slash command/ai-image-generator
๐๏ธ Context preview
The summary Claude sees to decide when to auto-load this skill.
Generate AI images using Gemini or GPT APIs directly. Covers model selection (Gemini for scenes; GPT Image 2 for text rendering, batch variations, multi-reference compositing; GPT Image 1.5 for transparent icons), the 5-part prompting framework, API calling patterns, multi-turn
๐ Stats
Stars940
Forks96
LanguagePython
LicenseMIT
๐ฆ Ships with jezweb-skills
</> SKILL.md
ai-image-generator.SKILL.md
---name: ai-image-generator
description: "Generate AI images using Gemini or GPT APIs directly. Covers model selection (Gemini for scenes; GPT Image 2 for text rendering, batch variations, multi-reference compositing; GPT Image 1.5 for transparent icons), the 5-part prompting framework, API calling patterns, multi-turn editing, and quality assurance. Produces photorealistic scenes, icons, illustrations, OG images, posters, infographics, and product shots. Use when building websites that need images, creating marketing assets, or generating visual content. Triggers: 'generate image', 'ai image', 'create hero image', 'make an icon', 'generate illustration', 'create og image', 'poster', 'infographic', 'image variations', 'gpt-image-2', 'ai art', 'image generation'."
allowed-tools:
- Read
- Write
- Bash
- Glob
- Grep
compatibility: claude-code-only
---# AI Image Generator
Generate images using AI APIs (Google Gemini and OpenAI GPT). This skill teaches the prompting patterns and API mechanics for producing professional images directly from Claude Code.
> **Managed alternative**: If you don't want to manage API keys, [ImageBot](https://imagebot.au) provides a managed image generation service with album templates and brand kit support.
## Model Selection
Choose the right model for the job:
| Need | Model | Why |
|------|-------|-----|
| **Photorealistic scenes / stock photos** | Gemini 3.1 Flash Image | Best depth, complexity, environmental context |
**Verify model IDs before use** โ they change frequently:
```bash
curl -s "https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_API_KEY" | python3 -c "import sys,json; [print(m['name']) for m in json.load(sys.stdin)['models'] if 'image' in m['name'].lower()]"
```
## GPT Image 2 Specifics
Released 2026-04-22. Three capabilities that change when you'd reach for it.
### 1. Text rendering actually works
Posters, OG images with headlines, infographics with labels, UI mockups, pricing cards. Text is rendered reliably, including non-Latin scripts (Japanese, Korean, Hindi, Bengali). Primary reason to switch from Gemini โ Gemini doesn't render readable text at all.
### 2. Multi-variation batching
One prompt, up to 10 images in a single call. Variants share composition and palette but differ in detail. Good for style exploration before committing, A/B options for a client, rapid ideation.
### 3. Multi-reference compositing
Feed reference images alongside your prompt โ product shots, lifestyle scenes, logos. The model places the product into the scene with correct lighting, scale, perspective. Enables "product in context" workflows without multi-turn editing.
### Modes
- **Instant** (default, all plans) โ generates without a planning pass. Fast, good enough for most cases.
- **Thinking** (Plus/Pro/Business plans) โ plans layout before drawing. Use when element counts matter ("3 icons in a row", "5 feature bullets") or text must land in specific regions. Fewer re-rolls on complex compositions.
### Aspect ratios
3:1 ultra-wide through 1:3 ultra-tall, plus 1:1, 3:2, 2:3, 16:9, 9:16. Wider range than other models โ useful for website banners (ultra-wide hero) or mobile story formats (ultra-tall).
### Resolution
Up to 2K on the long edge standard. 4K in beta.
### Generation time
**Up to 2 minutes on complex prompts.** Build async UX โ don't block on the response. Show progress or spin off and poll.
### Constraints
- **No transparent backgrounds.** Fall back to `gpt-image-1.5` when you need PNG transparency.
- **API Org Verification may be required** before the endpoint fires โ enable in your OpenAI account settings if you hit auth errors on first call.
### Pricing (per 1024ร1024 image)
| Quality | Cost |
|---------|------|
| Low | $0.006 |
| Medium | $0.053 |
| High | $0.211 |
Token pricing: $5/M text in, $10/M text out, $8/M image in, $30/M image out.
## The 5-Part Prompting Framework
Build prompts in this order for consistent results:
### 1. Image Type
Set the genre: "A photorealistic photograph", "An isometric illustration", "A flat vector icon"
### 2. Subject
Who or what, with specific details: "of a warm, approachable Australian woman in her early 30s, smiling naturally"
### 3. Environment
Setting and spatial relationships: "in a bright modern home with terracotta decor on wooden shelves behind her"
### 4. Technical Specs
Camera and lighting: "Shot at 85mm f/2.0, natural window light, head and shoulders framing"
### 5. Constraints
What to exclude: "Photorealistic, no text, no watermarks, no logos"
### Example (Good vs Bad)
```
BAD โ keyword soup:
"professional woman, spa, warm lighting, high quality, 4K"
GOOD โ narrative direction:
"A professional skin treatment scene in a warm clinical setting.
A practitioner wearing blue medical gloves uses a microneedling pen
on the client's forehead. The client lies on a white treatment bed,
eyes closed, relaxed. Warm golden-hour light from a window to the
left. Terracotta-toned wall visible in the background. Shot at
85mm f/2.0, shallow depth of field. No text, no watermarks."
```
## Workflow
### 1. Determine Image Need
| Purpose | Aspect Ratio | Model |
|---------|-------------|-------|
| Hero banner (no text) | 16:9 or 21:9 | Gemini |
| Hero banner with headline copy | 16:9 or 3:1 ultra-wide | GPT Image 2 |
#### GPT Image 2 โ Text-heavy or Batch Variations
Use `gpt-image-2` when text has to render readably, or when you want 10 variants in one call. **No transparency** โ if you need transparent bg, use 1.5 above.