AgentSkillsCN

nano-banana-pro

通过aivault,利用Gemini具备图像生成能力的模型来生成或编辑图像(技能运行时无需Gemini API密钥)。

SKILL.md
--- frontmatter
name: nano-banana-pro
description: Generate or edit images via Gemini image-capable models through aivault (no Gemini API key in skill runtime).
compatibility: Requires `aivault` CLI and Node.js (runs via `npx tsx`).
credentials:
  - name: GEMINI_API_KEY
    description: Google Gemini API key for image generation and editing
    required: true

Nano Banana Pro (Gemini Image Generation)

This skill uses aivault to keep your Gemini API key safe. It calls the Gemini REST :generateContent endpoint through the gemini/models capability and saves the returned image.

Setup

Install aivault if it is not already available:

bash
curl -fsSL https://aivault.moldable.sh/install.sh | sh

Store your Gemini API key in aivault. The credential and all gemini/* capabilities are auto-provisioned from the built-in registry.

bash
aivault secrets create --name GEMINI_API_KEY --value "YOUR_API_KEY" --scope global

Quick start

bash
npx -y tsx {baseDir}/scripts/generate.ts --prompt "a cat eating a nano-banana" --filename ./out.png

Common examples

bash
# Higher resolution
npx -y tsx {baseDir}/scripts/generate.ts --prompt "a cozy reading nook" --filename ./out.png --resolution 2K

# Edit with input image(s)
npx -y tsx {baseDir}/scripts/generate.ts --prompt "make it look like a watercolor painting" --filename ./out.png -i ./in.png

# Raw upstream JSON
npx -y tsx {baseDir}/scripts/generate.ts --prompt "a cat eating a nano-banana" --filename ./out.png --json

Notes

  • Default model is gemini-3-pro-image-preview (override with --model).
  • Uses generationConfig.responseModalities=["TEXT","IMAGE"] and generationConfig.imageConfig.imageSize.