mcpField
N
nano-banana-2

nano-banana-2

github.com/inference-sh创意与媒体7901.1k 次安装2 周前更新
代码仓库

关于 nano-banana-2

通过 inference.sh CLI 调用 Gemini 3.1 Flash Image Preview 的图像生成技能,面向需要生成或编辑图像的创作者。支持多张输出、不同宽高比和分辨率,并可启用 Google Search 信息 grounding。

主要功能

  1. 01文本生成图像
  2. 02基于输入图像编辑
  3. 03生成多张图像
  4. 04设置宽高比与分辨率
  5. 05启用 Google Search grounding

适用场景

  1. 01生成插画、产品视觉或场景图
  2. 02为现有图像添加或修改元素
  3. 03按指定比例生成社交媒体素材

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/inference-sh/skills --skill nano-banana-2

安装后在 Claude Code 中输入/nano-banana-2确认已加载。

详细介绍

安装 belt CLI skill: npx skills add belt-sh/cli

Nano Banana 2 - Gemini 3.1 Flash Image Preview

通过 inference.sh CLI 使用 Google Gemini 3.1 Flash Image Preview 生成图像。

快速开始

需要 inference.sh CLI(belt)。安装说明

belt login

belt app run google/gemini-3-1-flash-image --input '{"prompt": "a banana in space, photorealistic"}'

示例

基础文生图
belt app run google/gemini-3-1-flash-image --input '{
  "prompt": "A futuristic cityscape at sunset with flying cars"
}'
多张图像
belt app run google/gemini-3-1-flash-image --input '{
  "prompt": "Minimalist logo design for a coffee shop",
  "num_images": 4
}'
自定义宽高比
belt app run google/gemini-3-1-flash-image --input '{
  "prompt": "Panoramic mountain landscape with northern lights",
  "aspect_ratio": "16:9"
}'
图像编辑(使用输入图像)
belt app run google/gemini-3-1-flash-image --input '{
  "prompt": "Add a rainbow in the sky",
  "images": ["https://example.com/landscape.jpg"]
}'
高分辨率(4K)
belt app run google/gemini-3-1-flash-image --input '{
  "prompt": "Detailed illustration of a medieval castle",
  "resolution": "4K"
}'
使用 Google 搜索 grounding
belt app run google/gemini-3-1-flash-image --input '{
  "prompt": "Current weather in Tokyo visualized as an artistic scene",
  "enable_google_search": true
}'

输入选项

参数类型描述
promptstring必填。 要生成或更改的内容
imagesarray用于编辑的输入图像(最多 14 张)。支持:JPEG、PNG、WebP
num_imagesinteger要生成的图像数量
aspect_ratiostring输出宽高比:"1:1"、"16:9"、"9:16"、"4:3"、"3:4"、"auto"
resolutionstring"1K"、"2K"、"4K"(默认:1K)
output_formatstring图像的输出格式
enable_google_searchboolean启用实时信息 grounding(天气、新闻等)

输出

字段类型描述
imagesarray生成或编辑后的图像
descriptionstring模型的文本描述或响应
output_metaobject关于输入/输出的定价元数据

提示词技巧

风格:照片级写实、插画、水彩、油画、数字艺术、动漫、3D 渲染

构图:特写、广角镜头、航拍视角、微距、肖像、风景

光线:自然光、影棚灯光、黄金时刻、戏剧性阴影、霓虹灯

细节:添加有关纹理、颜色、氛围和气氛的具体细节

示例工作流

# 1. Generate sample input to see all options
belt app sample google/gemini-3-1-flash-image --save input.json

# 2. Edit the prompt
# 3. Run
belt app run google/gemini-3-1-flash-image --input input.json

Python SDK

from inferencesh import inference

client = inference()

# Basic generation
result = client.run({
    "app": "google/gemini-3-1-flash-image@0c7ma1ex",
    "input": {
        "prompt": "A banana in space, photorealistic"
    }
})
print(result["output"])

# Stream live updates
for update in client.run({
    "app": "google/gemini-3-1-flash-image@0c7ma1ex",
    "input": {
        "prompt": "A futuristic cityscape at sunset"
    }
}, stream=True):
    if update.get("progress"):
        print(f"progress: {update['progress']}%")
    if update.get("output"):
        print(f"output: {update['output']}")

相关技能

# Original Nano Banana (Gemini 3 Pro Image, Gemini 2.5 Flash Image)
npx skills add inference-sh/skills@nano-banana

# Full platform skill (all apps)
npx skills add inference-sh/skills@infsh-cli

# All image generation models
npx skills add inference-sh/skills@ai-image-generation

浏览所有图像应用:belt app list --category image

文档

评论

支持 Markdown