スキル一覧に戻る
notque

gemini-imagen

by notque

Claude Code plugin for AI image generation using Google Gemini APIs

0🍴 0📅 2025年12月31日
GitHubで見るManusで実行

SKILL.md


name: gemini-imagen description: > Generate images using Google Gemini's image generation APIs via Python CLI. Use for "generate image", "create image", "gemini image", "AI image", or when needing AI image generation in Claude Code. version: 1.0.0 command: /imagen routing: triggers: - generate image - create image - gemini image - AI image - text to image complexity: simple category: image-generation

Gemini Imagen

Generate images from text prompts using Google's Gemini APIs. This plugin gives Claude Code the ability to generate images directly.


Quick Start

# Generate an image
python3 ~/.claude/plugins/gemini-imagen/skills/gemini-imagen/scripts/generate_image.py \
  --prompt "A cute cartoon cat" \
  --output cat.png

CRITICAL: Exact Model Names

Use ONLY these exact model strings:

Model StringSpeedBest For
gemini-2.5-flash-imageFast (2-5s)Drafts, iterations
gemini-3-pro-image-previewSlower (5-15s)Quality, text rendering, 2K

Common mistakes:

  • gemini-2.5-flash-preview-05-20 - WRONG (date suffixes are for text models)
  • gemini-2.5-pro-image - WRONG (doesn't exist)
  • gemini-3-flash-image - WRONG (doesn't exist)

Instructions

Step 1: Check API Key

echo "GEMINI_API_KEY is ${GEMINI_API_KEY:+set}"

If not set, tell the user to run /imagen:setup.

Step 2: Install Dependencies

pip install google-genai Pillow

Step 3: Generate Image

python3 ~/.claude/plugins/gemini-imagen/skills/gemini-imagen/scripts/generate_image.py \
  --prompt "YOUR PROMPT HERE" \
  --output /path/to/output.png

Step 4: Verify Output

ls -la /path/to/output.png

Model Selection

Use CaseModelWhy
Iterating on promptsgemini-2.5-flash-imageFast feedback (2-5s)
Final assetgemini-3-pro-image-previewBest quality
Game spritesgemini-2.5-flash-imageMany images, consistent
Text in imagegemini-3-pro-image-previewBetter typography
Batch generationgemini-2.5-flash-imageCost effective

Post-Processing Options

Remove Watermarks (--remove-watermark)

Removes bright pixels from image corners. Very useful for cleaning up generated images.

Background Transparency (--transparent-bg)

Converts solid-color backgrounds to transparent. Great for sprites and icons.

python3 generate_image.py \
  --prompt "Character on gray background" \
  --output char.png \
  --remove-watermark \
  --transparent-bg

Batch Generation

Generate multiple images from a file:

# prompts.txt (one per line)
python3 generate_image.py \
  --batch prompts.txt \
  --output-dir ./images/

Error Handling

ErrorSolution
GEMINI_API_KEY not setRun /imagen:setup
Rate limit (429)Wait 60s, script auto-retries
Content policy (400)Modify prompt
No image in responseAdd more detail to prompt
Pillow not installedRun pip install Pillow

Script Reference

Location: scripts/generate_image.py

ArgumentRequiredDescription
--promptYes*Text prompt
--outputYes*Output file path (.png)
--modelNoModel (default: gemini-3-pro-image-preview)
--remove-watermarkNoRemove corner watermarks
--transparent-bgNoMake background transparent
--bg-colorNoBackground hex color (default: #3a3a3a)
--batchNoPrompts file (one per line)
--output-dirNoDirectory for batch output

*Required unless using --batch

Exit Codes:

  • 0: Success
  • 1: Missing API key
  • 2: Generation failed
  • 3: Invalid arguments

What This Plugin CAN Do

  • Generate images from text prompts
  • Select between fast and quality models
  • Remove watermarks from images
  • Make backgrounds transparent
  • Batch generate multiple images

What This Plugin CANNOT Do

  • Use non-Gemini models (DALL-E, Midjourney, Stable Diffusion)
  • Generate video or audio
  • Bypass content policy restrictions

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です