nano-banana-2
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNano Banana 2 - Gemini 3.1 Flash Image Preview
Nano Banana 2 - Gemini 3.1 Flash Image Preview
Generate images with Google Gemini 3.1 Flash Image Preview via inference.sh CLI.
通过inference.sh CLI使用Google Gemini 3.1 Flash Image Preview生成图片。
Quick Start
快速开始
bash
curl -fsSL https://cli.inference.sh | sh && infsh login
infsh app run google/gemini-3-1-flash-image-preview --input '{"prompt": "a banana in space, photorealistic"}'Install note: The install script only detects your OS/architecture, downloads the matching binary from, and verifies its SHA-256 checksum. No elevated permissions or background processes. Manual install & verification available.dist.inference.sh
Examples
示例
Basic Text-to-Image
基础文本转图片
bash
infsh app run google/gemini-3-1-flash-image-preview --input '{
"prompt": "A futuristic cityscape at sunset with flying cars"
}'bash
infsh app run google/gemini-3-1-flash-image-preview --input '{
"prompt": "A futuristic cityscape at sunset with flying cars"
}'Multiple Images
生成多张图片
bash
infsh app run google/gemini-3-1-flash-image-preview --input '{
"prompt": "Minimalist logo design for a coffee shop",
"num_images": 4
}'bash
infsh app run google/gemini-3-1-flash-image-preview --input '{
"prompt": "Minimalist logo design for a coffee shop",
"num_images": 4
}'Custom Aspect Ratio
自定义宽高比
bash
infsh app run google/gemini-3-1-flash-image-preview --input '{
"prompt": "Panoramic mountain landscape with northern lights",
"aspect_ratio": "16:9"
}'bash
infsh app run google/gemini-3-1-flash-image-preview --input '{
"prompt": "Panoramic mountain landscape with northern lights",
"aspect_ratio": "16:9"
}'Image Editing (with input images)
图片编辑(含输入图片)
bash
infsh app run google/gemini-3-1-flash-image-preview --input '{
"prompt": "Add a rainbow in the sky",
"images": ["https://example.com/landscape.jpg"]
}'bash
infsh app run google/gemini-3-1-flash-image-preview --input '{
"prompt": "Add a rainbow in the sky",
"images": ["https://example.com/landscape.jpg"]
}'High Resolution (4K)
高分辨率(4K)
bash
infsh app run google/gemini-3-1-flash-image-preview --input '{
"prompt": "Detailed illustration of a medieval castle",
"resolution": "4K"
}'bash
infsh app run google/gemini-3-1-flash-image-preview --input '{
"prompt": "Detailed illustration of a medieval castle",
"resolution": "4K"
}'With Google Search Grounding
结合Google搜索 Grounding
bash
infsh app run google/gemini-3-1-flash-image-preview --input '{
"prompt": "Current weather in Tokyo visualized as an artistic scene",
"enable_google_search": true
}'bash
infsh app run google/gemini-3-1-flash-image-preview --input '{
"prompt": "Current weather in Tokyo visualized as an artistic scene",
"enable_google_search": true
}'Input Options
输入选项
| Parameter | Type | Description |
|---|---|---|
| string | Required. What to generate or change |
| array | Input images for editing (up to 14). Supported: JPEG, PNG, WebP |
| integer | Number of images to generate |
| string | Output ratio: "1:1", "16:9", "9:16", "4:3", "3:4", "auto" |
| string | "1K", "2K", "4K" (default: 1K) |
| string | Output format for images |
| boolean | Enable real-time info grounding (weather, news, etc.) |
| 参数 | 类型 | 说明 |
|---|---|---|
| string | 必填。要生成或修改的内容 |
| array | 用于编辑的输入图片(最多14张)。支持格式:JPEG、PNG、WebP |
| integer | 要生成的图片数量 |
| string | 输出比例:"1:1"、"16:9"、"9:16"、"4:3"、"3:4"、"auto" |
| string | 分辨率:"1K"、"2K"、"4K"(默认:1K) |
| string | 图片输出格式 |
| boolean | 启用实时信息 grounding(如天气、新闻等) |
Output
输出
| Field | Type | Description |
|---|---|---|
| array | The generated or edited images |
| string | Text description or response from the model |
| object | Metadata about inputs/outputs for pricing |
| 字段 | 类型 | 说明 |
|---|---|---|
| array | 生成或编辑后的图片 |
| string | 模型返回的文本描述或响应 |
| object | 用于计费的输入/输出元数据 |
Prompt Tips
提示词技巧
Styles: photorealistic, illustration, watercolor, oil painting, digital art, anime, 3D render
Composition: close-up, wide shot, aerial view, macro, portrait, landscape
Lighting: natural light, studio lighting, golden hour, dramatic shadows, neon
Details: add specific details about textures, colors, mood, atmosphere
风格:写实风、插画、水彩画、油画、数字艺术、动漫、3D渲染
构图:特写、广角镜头、航拍、微距、人像、风景
光线:自然光、影棚灯光、黄金时刻、戏剧性阴影、霓虹光
细节:添加关于纹理、颜色、情绪、氛围的具体细节
Sample Workflow
示例工作流
bash
undefinedbash
undefined1. Generate sample input to see all options
1. 生成示例输入以查看所有选项
infsh app sample google/gemini-3-1-flash-image-preview --save input.json
infsh app sample google/gemini-3-1-flash-image-preview --save input.json
2. Edit the prompt
2. 编辑提示词
3. Run
3. 运行
infsh app run google/gemini-3-1-flash-image-preview --input input.json
undefinedinfsh app run google/gemini-3-1-flash-image-preview --input input.json
undefinedPython SDK
Python SDK
python
from inferencesh import inference
client = inference()python
from inferencesh import inference
client = inference()Basic generation
基础生成
result = client.run({
"app": "google/gemini-3-1-flash-image-preview@0c7ma1ex",
"input": {
"prompt": "A banana in space, photorealistic"
}
})
print(result["output"])
result = client.run({
"app": "google/gemini-3-1-flash-image-preview@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-preview@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']}")
undefinedfor update in client.run({
"app": "google/gemini-3-1-flash-image-preview@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']}")
undefinedRelated Skills
相关技能
bash
undefinedbash
undefinedOriginal Nano Banana (Gemini 3 Pro Image, Gemini 2.5 Flash Image)
原版Nano Banana(Gemini 3 Pro Image、Gemini 2.5 Flash Image)
npx skills add inference-sh/skills@nano-banana
npx skills add inference-sh/skills@nano-banana
Full platform skill (all 150+ apps)
全平台技能(包含150+应用)
npx skills add inference-sh/skills@inference-sh
npx skills add inference-sh/skills@inference-sh
All image generation models
所有图片生成模型
npx skills add inference-sh/skills@ai-image-generation
Browse all image apps: `infsh app list --category image`npx skills add inference-sh/skills@ai-image-generation
浏览所有图片类应用:`infsh app list --category image`Documentation
文档
- Running Apps - How to run apps via CLI
- Streaming Results - Real-time progress updates
- File Handling - Working with images