agentleFS
boltguoboltguo/skills/gemini-image-gen/SKILL.md

gemini-image-gen

Skill1 starsChanged 26 days agoMITView on GitHub

Generate images using the Gemini API (AI Studio key). Use when user asks to generate/create images with Gemini, Google AI, or mentions '图片生成', 'Gemini 生图', 'AI 生图', 'generate image', 'create image'.

  • Reads credentials

7 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions7 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 7

    1. emanueleielo/ciana-parrot★ 77same name
    2. maystudios/claude-skills★ 21same name
    3. kaiye/skills★ 19same name
    4. seanwinslow28/anima★ 2same name
    5. JIANMORIVER/hermes-skills★ 1same name
    6. yourkenike/ciana-parrot★ 1same name
    7. dogank85/claude-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Must use uppercase K. Unsupported values are caught by the script and fall back (512→1K, others→2K).

    line 34
  2. Very specific:

    Run the script: Call generate_image.py directly using the defaults (2K, 16:9, HIGH thinking), overriding flags only when requested by the …

    line 78

“Common” is measured: kept by at least 6 in 10 of the 4 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

python <skill-path>/scripts/generate_image.py "your prompt here"

Output: gemini-images/{timestamp}-{slug}/ containing prompt.md, image.png, and optionally response.json.

Requirements

GEMINI_API_KEY or GOOGLE_API_KEY env var (get key).

First-time permission setup:

claude config add permissions.allow "Bash(python */gemini-image-gen/scripts/generate_image.py*)"

Model

ModelNotes
gemini-nano-banana-2.1Default (Nano Banana 2.1). Image-only output (responseModalities: ["IMAGE"]), thinkingConfig (HIGH default), Google Web/Image Search grounding, up to 14 ref images

Parameters

--image-size

Must use uppercase K. Unsupported values are caught by the script and fall back (512→1K, others→2K).

ValueSupportedNotes
1KYesFast preview / standard resolution
2KYesDefault. Balanced quality & size
4KYesUltra-high resolution

--aspect-ratio

Supports 14 aspect ratios (including ultra-wide and panoramic ratios with fixed tiling at 2K/4K):

1:1 · 1:4 · 1:8 · 2:3 · 3:2 · 3:4 · 4:1 · 4:3 · 4:5 · 5:4 · 8:1 · 9:16 · 16:9 (default) · 21:9

Unsupported ratio auto-falls back to 16:9.

--thinking-level

Controls the reasoning depth before generating the final image (case-insensitive):

ValueNotes
HIGHDefault. Maximum reasoning for complex layouts and prompts
MEDIUMBalanced composition reasoning & speed
MINIMALFastest latency, minimal interim reasoning

Unsupported level auto-falls back to HIGH.

-i / --image (Reference Images)

Pass up to 14 local reference images (.png, .jpg/.jpeg, .webp, .heic, .heif, .gif) for image editing, sketch-to-image, character consistency (up to 4 characters), or multi-object fusion (up to 10 objects):

python <skill-path>/scripts/generate_image.py "prompt" -i ref1.png ref2.jpg

Other flags

  • --save-request: Save response.json (Gemini API response) to output folder
  • --output-dir: Override auto-generated output path

Usage

  1. Craft the prompt: Refine the user's request into a clear, detailed prompt (English works best, or match user's text requirements if rendering specific text in the image).
  2. Run the script: Call generate_image.py directly using the defaults (2K, 16:9, HIGH thinking), overriding flags only when requested by the user or implied by the use case (e.g., 9:16 for mobile wallpapers/posters, -i when reference images are provided):
    python <skill-path>/scripts/generate_image.py "prompt" [--aspect-ratio ...] [--image-size ...] [--thinking-level ...] [-i ref1.png ...] [--save-request]
  3. Return results: Show the generated image and report the output folder path (or inform the user if success: false).

Prompt Tips

  • Style: "oil painting", "3D render", "watercolor", "photorealistic"
  • Lighting: "golden hour", "dramatic rim lighting", "soft diffused"
  • Composition: "bird's eye view", "close-up", "wide establishing shot"
  • Mood: "mysterious", "cheerful", "melancholic", "epic"
  • Text in images: 25 characters or fewer

Error Handling

ErrorCauseFix
400Invalid parameterCheck supported values for the chosen model
401/403Bad API keyCheck env var
429Rate limitWait and retry
success: falseNo image generated (safety filter or text-only response)Adjust prompt

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.