360 Secure SkillHub
360 安全技能中心

Nano Banana Pro Enhanced

这是基于Gemini 3 Pro Image的图片处理工具,核心功能含单图生成(可指定分辨率、宽高比)、单图编辑(需传入原图),及50%优惠的批量非阻塞API(支持多任务批量提交、结果查询)。典型场景包括单图创作、批量图片生产。需依赖uv环境与GEMINI_API_KEY,通过命令行调用,输入为参数或JSON批量文件,输出图片保存路径,需用mediaUrl分发。

steamb23
steamb23
热度 60.83
最近更新 2026-05-17 12:13:53
分类:创作依赖:代码执行 / 第三方 API / 读写文件应用场景:图像生成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add nano-banana-pro-enhanced
Metadata
name
nano-banana-pro-enhanced
description
Generate or edit images via Gemini 3 Pro Image (Nano Banana Pro).
metadata
{"openclaw":{"emoji":"🍌","homepage":"https://ai.google.dev/","primaryEnv":"GEMINI_API_KEY","requires":{"bins":["uv"],"env":["GEMINI_API_KEY"]},"install":[{"id":"uv-brew","kind":"brew","formula":"uv","bins":["uv"],"label":"Install uv (brew)"}]}}

Nano Banana Pro (Gemini 3 Pro Image)

Use the bundled script to generate or edit images.

Generate

uv run {baseDir}/scripts/generate_image.py --prompt "your image description" --filename "output.png" --resolution 1K --aspect-ratio 16:9

Edit

uv run {baseDir}/scripts/generate_image.py --prompt "edit instructions" --filename "output.png" --input-image "/path/in.png" --resolution 2K

Batch API (50% cheaper, non-blocking)

# Single image
uv run {baseDir}/scripts/generate_image.py --prompt "description" --filename "output.png" --batch

# Multiple images from JSON file
uv run {baseDir}/scripts/generate_image.py --batch-file .tmp/requests.json

# Check / retrieve result of a previous job
uv run {baseDir}/scripts/generate_image.py --batch-check "batches/abc123" --filename "output.png"

Batch file format (JSON array):

[
  {
    "prompt": "a cute cat",
    "filename": "cat.png",
    "resolution": "1K",
    "aspect_ratio": "16:9"
  },
  {
    "prompt": "a dog running",
    "filename": "dog.png",
    "resolution": "2K"
  }
]

Batch notes

  • --batch is always non-blocking: submits the job, prints BATCH_JOB: token, and exits immediately.
  • After submitting, add a temporary check list to HEARTBEAT.md. Include why this image was requested (context/intent), so it's clear even after a session reset.
    # Temporary Check List
    
    - **Nano Banana Batch job**: <why this image was requested>. Check `batches/abc123` for job result. When ready, retrieve and send to user with mediaUrl parameter. Remove this item after reporting the result.
    
  • If the user explicitly requests a timed check, use a cronjob instead of HEARTBEAT.md.
  • The script tracks pending jobs in memory/pending-batch-jobs.json. Created on batch submit, removed on --batch-check completion. Format: [{"job_name", "filename", "prompt", "created_at"}]. File is deleted when empty.

API key

  • GEMINI_API_KEY env var
  • Or set skills."nano-banana-pro".apiKey / skills."nano-banana-pro".env.GEMINI_API_KEY in ~/.clawdbot/clawdbot.json

Notes

  • Resolutions: 1K (default), 2K, 4K.
  • Aspect ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9. Generation only (ignored for editing).
  • Use timestamps in filenames: YYYYMMDD-hhmmss-name.png.
  • The script outputs the saved file path. To send images via messaging channels, use the mediaUrl parameter in your channel action (e.g., mediaUrl: "/absolute/path/to/output.png").
  • Do not read the image back; report the saved path and use it with mediaUrl to deliver the image to the user.