搜索

PythonReactSEOPDF
GitHub Skill

nano-banana-pro

Generate images via Gemini 3 Pro Image API. Use when "generate an image", "create a hero image", "make an image showing", "nano banana".

Eddale☆ 0 仓库 Stars0 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Nano Banana Pro

Generate images using Google's Gemini 3 Pro Image API with native resolution support (1K/2K/4K) and flexible aspect ratios.

When This Activates

  • "Generate an image of..."
  • "Create a hero image for..."
  • "Make an image showing..."
  • "Nano banana [description]"
  • Any request to create/generate an image

How It Works

  1. Parse the request for: prompt, resolution, aspect ratio, character reference
  2. Run the Python tool with extracted parameters
  3. Report the generated image path to the user

Parameter Detection

Resolution

Note: The google-genai SDK (v1.47.0) currently only supports aspect ratio control. Resolution parameters (1K/2K/4K) are documented by Google but not yet available in the Python SDK. Images generate at ~1K by default. Resolution control will be added when SDK support arrives.

For now, accept --size parameter but ignore it (generates at default resolution).

Aspect Ratio (defaults to 16:9)
Mentioned Maps To
"landscape", "hero image", "banner" 16:9
"portrait", "vertical", "story" 9:16
"square", "thumbnail", "profile" 1:1
"Instagram", "social post" 4:5
Explicit ratio (e.g., "3:2") Use as-is

Supported ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9

Character Reference
  • If user says "me", "image of me", "myself" → use --ed flag
  • If user provides a path → use --reference <path>
  • Otherwise → no reference image
Output Location
  • Default: ~/Downloads/
  • If user specifies folder → use that path
  • Filename: content-based (e.g., hero-coaching-clarity.png)

Prompting Best Practices (Built In)

When constructing the prompt for the API, apply these principles:

  1. Keep it concise - Under 25 words performs best. Don't pad with tags.
  2. Natural language - Write like briefing a photographer, not keyword soup.
  3. Positive framing - Say what you want, not what you don't want.
    • Good: "empty room with wooden floors"
    • Bad: "room without furniture"
  4. Specific visual details - Include lighting, composition, mood when relevant.
  5. Style goes in the prompt - No separate style parameter. Include style naturally:
    • "professional photography style"
    • "manga illustration style"
    • "minimalist graphic design"

Execution

Run the Python tool:

python3 skills/nano-banana-pro/tools/generate_image.py \
  "<prompt>" \
  --size <1K|2K|4K> \
  --aspect <ratio> \
  [--ed | --reference <path>] \
  --output <folder> \
  --name <filename_prefix>

The tool returns JSON:

{
  "success": true,
  "path": "/Users/eddale/Downloads/hero-coaching-clarity.png",
  "resolution": "1K",
  "aspect_ratio": "16:9",
  "cost_estimate": "$0.134"
}

After Generation

  1. Report the image path to the user
  2. If requested, link in daily note Captures section
  3. If user wants to iterate, offer to regenerate with modified prompt

Example Interactions

User: "Generate a hero image for my article about the power of clarity in coaching"

What happens:

  • Resolution: 1K (default)
  • Aspect: 16:9 (hero image default)
  • Reference: None (no "me" mentioned)
  • Prompt: "Professional photograph of a lighthouse beacon cutting through fog at dawn, symbolizing clarity and guidance, warm golden light, cinematic composition"

User: "Create a 4K image of me presenting to a small group, professional photography"

What happens:

  • Resolution: 4K (explicitly requested)
  • Aspect: 16:9 (default)
  • Reference: Ed's image (--ed flag)
  • Prompt: "Professional photograph of [reference person] presenting to an engaged small group in a modern meeting room, natural lighting, documentary style"

User: "Make a 1:1 thumbnail showing a lightbulb moment"

What happens:

  • Resolution: 1K (default)
  • Aspect: 1:1 (explicitly requested)
  • Reference: None
  • Prompt: "Stylized illustration of a glowing lightbulb above a person's head, warm yellow light radiating outward, clean minimal background, insight concept"

Pricing

~$0.134 per image (default resolution, ~1K)

Higher resolution pricing (when SDK supports it):

  • 2K: ~$0.24
  • 4K: ~$0.24

Error Handling

  • Missing GOOGLE_API_KEY: Tell user to set environment variable in ~/.zshrc
  • Invalid aspect ratio: Default to 16:9 and warn user
  • API failure: Report error, suggest retry or modified prompt
  • Reference image not found: Continue without reference, warn user

Style Library

Check resources/style-library.md for prompts that have worked well. Add new successful styles there to build our library over time.

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-26
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!