AgentSkillsCN

generate

纳米香蕉 Pro(nano-banana-pro)图像生成技能。当用户提出“生成一张图片”“生成多张图片”“创建一张图片”“制作一张图片”,或使用“纳米香蕉”这一关键词,又或是需要生成多张图片,如“生成 5 张图片”时,均可调用此技能。该技能依托 Google 的 Gemini 2.5 Flash 模型,可满足各类图像生成需求——无论是前端设计、网页项目、插画创作、图形设计、主图展示、图标制作、背景素材,还是独立的艺术作品。无论何种图像生成需求,均可调用此技能。

SKILL.md
--- frontmatter
name: generate
description: Nano Banana Pro (nano-banana-pro) image generation skill. Use this skill when the user asks to "generate an image", "generate images", "create an image", "make an image", uses "nano banana", or requests multiple images like "generate 5 images". Generates images using Google's Gemini 2.5 Flash for any purpose - frontend designs, web projects, illustrations, graphics, hero images, icons, backgrounds, or standalone artwork. Invoke this skill for ANY image generation request.

Nano Banana Pro - Gemini Image Generation

Generate custom images using Google's Gemini models for integration into frontend designs.

Prerequisites

Set the GEMINI_API_KEY environment variable with your Google AI API key.

Available Models

ModelIDBest ForMax Resolution
Flashgemini-2.5-flash-imageSpeed, high-volume tasks1024px
Progemini-3-pro-image-previewProfessional quality, complex scenesUp to 4K

Image Generation Workflow

Step 1: Generate the Image

Use scripts/image.py with uv. The script is located in the skill directory at skills/generate/scripts/image.py:

bash
uv run "${SKILL_DIR}/scripts/image.py" \
  --prompt "Your image description" \
  --output "/path/to/output.png"

Where ${SKILL_DIR} is the directory containing this SKILL.md file.

Options:

  • --prompt (required): Detailed description of the image to generate
  • --output (required): Output file path (PNG format)
  • --aspect (optional): Aspect ratio - "square", "landscape", "portrait" (default: square)
  • --reference (optional): Path to a reference image for style, composition, or content guidance
  • --model (optional): Model to use - "flash" (fast) or "pro" (high-quality) (default: flash)
  • --size (optional): Image resolution for pro model - "1K", "2K", "4K" (default: 1K, ignored for flash)

Using Different Models

Flash model (default) - Fast generation, good for iterations:

bash
uv run "${SKILL_DIR}/scripts/image.py" \
  --prompt "A minimalist logo design" \
  --output "/path/to/logo.png" \
  --model flash

Pro model - Higher quality for final assets:

bash
uv run "${SKILL_DIR}/scripts/image.py" \
  --prompt "A detailed hero illustration for a tech landing page" \
  --output "/path/to/hero.png" \
  --model pro \
  --size 2K

Using a Reference Image

To generate an image based on an existing reference:

bash
uv run "${SKILL_DIR}/scripts/image.py" \
  --prompt "Create a similar abstract pattern with warmer colors" \
  --output "/path/to/output.png" \
  --reference "/path/to/reference.png"

The reference image helps Gemini understand the desired style, composition, or visual elements you want in the generated image.

Step 2: Integrate with Frontend Design

After generating images, incorporate them into frontend code:

HTML/CSS:

html
<img src="./generated-hero.png" alt="Description" class="hero-image" />

React:

jsx
import heroImage from './assets/generated-hero.png';
<img src={heroImage} alt="Description" className="hero-image" />

CSS Background:

css
.hero-section {
  background-image: url('./generated-hero.png');
  background-size: cover;
  background-position: center;
}

Crafting Effective Prompts

Write detailed, specific prompts for best results:

Good prompt:

A minimalist geometric pattern with overlapping translucent circles in coral, teal, and gold on a deep navy background, suitable for a modern fintech landing page hero section

Avoid vague prompts:

A nice background image

Prompt Elements to Include

  1. Subject: What the image depicts
  2. Style: Artistic style (minimalist, abstract, photorealistic, illustrated)
  3. Colors: Specific color palette matching the design system
  4. Mood: Atmosphere (professional, playful, elegant, bold)
  5. Context: How it will be used (hero image, icon, texture, illustration)
  6. Technical: Aspect ratio needs, transparency requirements

Integration with Frontend-Design Skill

When used alongside the frontend-design skill:

  1. Plan the visual hierarchy - Identify where generated images add value
  2. Match the aesthetic - Ensure prompts align with the chosen design direction (brutalist, minimalist, maximalist, etc.)
  3. Generate images first - Create visual assets before coding the frontend
  4. Reference in code - Use relative paths to generated images in your HTML/CSS/React

Example Workflow

  1. User requests a landing page with custom hero imagery
  2. Invoke nano-banana-pro to generate the hero image with a prompt matching the design aesthetic
  3. Invoke frontend-design to build the page, referencing the generated image
  4. Result: A cohesive design with custom AI-generated visuals

Output Location

By default, save generated images to the project's assets directory:

  • ./assets/ for simple HTML projects
  • ./src/assets/ or ./public/ for React/Vue projects
  • Use descriptive filenames: hero-abstract-gradient.png, icon-user-avatar.png