agentleFS
xingfanxiaxingfanxia/AX-skills/gemini-image/SKILL.md

gemini-image

Skill4 starsChanged 54 days agoMITView on GitHub

Generate images or image edits with Google Gemini / Nano Banana. Use for Gemini image, nano banana, multi-reference image edits, background swaps, character consistency, style transfer, or soft illustrated / watercolor / anime aesthetics; prefer gpt-image for readable text, large same-prompt batches, and sharp product/editorial defaults.

  • Reads credentials

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use deepl, imagemagick-conversion and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • zephyrwang6Skill

    deepl

    Übersetzt Texte, Dokumente und XLIFF-Dateien via DeepL API. Verwende für Übersetzungen mit /deepl translate, /deepl file oder /deepl xliff.

    Also in 4 projects that use this

  • zephyrwang6Skill

    imagemagick-conversion

    Convert and manipulate images with ImageMagick. Covers format conversion, resizing, batch processing, quality adjustment, and image transformations. Use when user mentions image conversion, resizing images, ImageMagick, magick command, batch image processing, or thumbnail generation.

    Also in 4 projects that use this

  • +10 more from zephyrwang6

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When the request is ambiguous about aesthetic, default to gpt-image (it's the platform default — JPG output, smaller files, faster …

    line 74

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Gemini Image Generation

Image generation via Google's Gemini multimodal API.

Setup (one-time)

# Install via the AX-skills repo
git clone https://github.com/xingfanxia/AX-skills.git ~/projects/devtools/AX-skills
ln -sf ~/projects/devtools/AX-skills/gemini-image ~/.claude/skills/gemini-image
ln -sf ~/projects/devtools/AX-skills/gemini-image ~/.codex/skills/gemini-image

# Get API key from Google AI Studio: https://aistudio.google.com/apikey
# Either export GEMINI_API_KEY in your shell, or:
echo 'GEMINI_API_KEY=your_key_here' > ~/projects/devtools/AX-skills/gemini-image/.env

.env is gitignored. The script auto-installs deps on first run via uv (no manual venv needed).

Quick start

# Single image
~/.claude/skills/gemini-image/generate.py "a cyberpunk cat reading a book"

# Specific aspect / resolution
~/.claude/skills/gemini-image/generate.py "Studio Ghibli landscape" --aspect 16:9 --resolution 4K

# Multiple variations of the same prompt
~/.claude/skills/gemini-image/generate.py "watercolor lighthouse" --n 3 --name lighthouse

# Multi-reference edit (background swap)
~/.claude/skills/gemini-image/generate.py "swap the background to a tropical beach" \
  --reference original.png

# Character consistency across scenes
~/.claude/skills/gemini-image/generate.py "the same character now drinking coffee" \
  --reference scene1.png --reference scene2.png

# Highest quality (Nano Banana Pro), or compare both tiers side-by-side
~/.claude/skills/gemini-image/generate.py "editorial portrait" --model pro
~/.claude/skills/gemini-image/generate.py "editorial portrait" --ab-test --name compare

CLI

FlagPurposeDefault
promptImage prompt (positional, required)—
--modelnb2 (Nano Banana 2, gemini-3.1-flash-image) or pro (Nano Banana Pro, gemini-3-pro-image)nb2
--ab-testGenerate with BOTH model tiers; filenames get _nb2 / _pro suffixoff
--resolution1K / 2K / 4K2K
--aspectAspect ratio (1:1, 16:9, 9:16, etc.)16:9
--outputOutput directory~/Downloads/gemini-image/
--nameStable filename stem (default: timestamp). For --n>1, _1.._N suffix appended.timestamp
--nNumber of variations to generate sequentially1
--referenceReference image path (repeatable, max 14)none

Routing — gemini-image vs gpt-image

These are sister skills, not specialists. The most predictable distinguishers:

Picks for gemini-imagePicks for gpt-image
Multi-reference image input (background swap, character across scenes, style transfer) — gpt-image cannot accept reference images at allImage must contain rendered text that has to be readable
Soft / illustrated / hand-drawn / Studio Ghibli / Chiikawa / watercolor aestheticPhotorealistic editorial, product shots, UI mockups, brand imagery (default)
You want a warmer / more painterly defaultBatches > 5 same-prompt (gpt-image has built-in --n concurrency)

When the request is ambiguous about aesthetic, default to gpt-image (it's the platform default — JPG output, smaller files, faster batching). If the result reads "wrong tone", regenerate with gemini-image.

Parallel generation

For different prompts in parallel, use shell backgrounding:

~/.claude/skills/gemini-image/generate.py "prompt A" --name a &
~/.claude/skills/gemini-image/generate.py "prompt B" --name b &
~/.claude/skills/gemini-image/generate.py "prompt C" --name c &
wait

For same-prompt variations, use --n N (sequential within a single process).

Output format

Defaults to PNG (Gemini API returns PNG). Convert to JPG to save space (~75% smaller) when transparency isn't needed:

sips -s format jpeg -s formatOptions 85 in.png --out out.jpg

中文文字排版纪律 (CJK text discipline)

Any prompt that renders Chinese text MUST end with this suffix, appended verbatim (prompt + SUFFIX — a hard invariant you concatenate every time, never trust the model to remember it):

禁止:文字重叠、文字压在复杂图像上、伪汉字乱码、逐字竖排英文、
超过两种字体、页面四边贴字无留白、装饰元素盖过标题、每页超过 5 个信息块。
  • >30 字正文 → 留位策略: image models cannot reliably render long CJK body text. Have the model draw only layout + visuals, leave the text zone blank, overlay real text in post (PPT / image editor). This is the only reliable approach for long Chinese copy. (For text that must render readably, gpt-image is the stronger pick anyway — see routing above.)
  • 成套图 cover-first: generate the cover first (locks the style), then 1 content image to verify style match, then batch the rest — same style brief injected into every prompt, only content parameters vary. Re-check against the cover every ~5 images; on drift, regenerate reusing the cover prompt's style paragraph (--reference cover.png also helps here).
  • 中文横排;标点不出现在行首;中英混排时英文占比 ≤ 20%。
<!-- Adapted from staruhub/ClaudeSkills (MIT) -->

Cost note

Both models are GA (previews shut down 2026-06-25). nb2 (gemini-3.1-flash-image) output: $0.067/1K, $0.101/2K, $0.151/4K per image; pro (gemini-3-pro-image) costs roughly 2x nb2. Check current pricing at https://ai.google.dev/gemini-api/docs/pricing.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.