Nano Banana 2 API
Google Nano Banana 2(Gemini 3.1 Flash Image)以 Flash 的速度提供 Pro 品質的圖像生成。解析度範圍從 512px 到 4K,文字渲染更佳,最多可維持 5 個角色的一致性,並整合真實世界知識。
提供標準的文字轉圖片與編輯端點,以及 Fast 版本(Nano Banana 2 中最便宜的選項)。可選用網頁搜尋與圖片搜尋,為生成內容加入真實世界知識。預設 2K,並可使用 4K。
/filters:quality(82)/examples/0e2e636e41341ac4132145a4ba6a911b/1783683544102329139_iRAJS1bk.webp)
概覽
關於 Nano Banana 2 API
Nano Banana 2 的功能、它在 Google 模型陣容中的定位,以及團隊選用它的原因。
Nano Banana 2 是來自 Google 的圖片生成與編輯模型,可透過 WaveSpeedAI REST API 使用。Google Nano Banana 2(Gemini 3.1 Flash Image)以 Flash 的速度提供 Pro 品質的圖像生成。解析度範圍從 512px 到 4K,文字渲染更佳,最多可維持 5 個角色的一致性,並整合真實世界知識。
提供標準的文字轉圖片與編輯端點,以及 Fast 版本(Nano Banana 2 中最便宜的選項)。可選用網頁搜尋與圖片搜尋,為生成內容加入真實世界知識。預設 2K,並可使用 4K。
WaveSpeedAI 上的 Nano Banana 2 系列提供 6 個 REST 端點,涵蓋 Text-To-Image, Image-To-Image 等工作流程。每個變體都有各自的定價、參數選項與範例輸出 — 請挑選符合您輸入模態與生產限制的版本,或使用同一組 API 金鑰呼叫多個變體,組合成多步驟的處理流程。
使用您呼叫其他 1,000+ 個 WaveSpeedAI AI 模型時相同的 API 金鑰、帳單帳戶與速率限制額度來執行 Nano Banana 2。無需另外設定供應商、無需各家 SDK、無需處理各家不同的速率限制 — 一次整合,涵蓋從文字轉圖片、文字轉影片,到音訊合成、3D 生成、放大與編輯的所有功能。
端點
所有 Nano Banana 2 API 端點
WaveSpeedAI 目前提供 6 個 Nano Banana 2 端點 — 請選擇符合您工作流程的變體。
/filters:quality(82)/media/images/20260408104558_t6mp9lus.webp)
Nano Banana 2 Text To Image Fast
Google Nano Banana 2 Fast (Gemini 3.1 Flash Image) is the cheapest Nano Banana 2 option, starting at just $0.045 per image. Delivers fast text-to-image generation with 2K default output and 4K support. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
/filters:quality(82)/media/images/20260408104604_srl763ml.webp)
Nano Banana 2 Text To Image
Google Nano Banana 2 (Gemini 3.1 Flash Image) delivers Pro-quality image generation at Flash speed with 512px to 4K resolution support. Features include improved text rendering, character consistency for up to 5 characters, and real-world knowledge integration. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
/filters:quality(82)/media/images/20260408104544_zo6kw479.webp)
Nano Banana 2 Edit Fast
Google Nano Banana 2 Edit Fast (Gemini 3.1 Flash Image) is the cheapest Nano Banana 2 editing option, starting at just $0.045 per image. Enables fast image editing with 2K default output and 4K support. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
/filters:quality(82)/media/images/20260408104538_77qog4ig.webp)
Nano Banana 2 Edit
Google Nano Banana 2 Edit (Gemini 3.1 Flash Image) enables advanced image editing with 4K-capable output, fast iteration, and precise instruction following. Supports text translation, localization within images, and maintains subject consistency during edits. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
/filters:quality(82)/media/images/1782846273040443129_5T5fPY8h.webp)
Nano Banana 2 Lite Edit
Google Nano Banana 2 Lite Edit transforms uploaded images with text instructions, supporting fast prompt-guided image editing, visual refinements, and creative changes with low latency. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
/filters:quality(82)/media/images/1782846259821818886_jg1SZaB3.webp)
Nano Banana 2 Lite Text To Image
Google Nano Banana 2 Lite Text to Image generates high-quality images from text prompts with low latency, flexible aspect ratios, and fast image creation for creative and production workflows. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
範例
看看 Nano Banana 2 的實際效果
由 Nano Banana 2 API 生成的真實輸出。將滑鼠移到任一影片上即可預覽,點擊可開啟完整尺寸檢視器。
使用方式
如何使用 Nano Banana 2 API
從註冊到完成生成,只要四個步驟。完整的 Python、Node.js 與 cURL 範例請見下方的 API 區段。
- 01
取得 API 金鑰
註冊 WaveSpeedAI 帳號,並從控制台複製您的 API 金鑰。新帳號會獲贈免費入門點數 — 足以在開始計費前執行數十次 Playground。
- 02
提交 prediction
將您的輸入以 JSON 格式 POST 到 https://api.wavespeed.ai/api/v3/google/nano-banana-2/text-to-image。端點會立即回傳 prediction id — 生成是非同步進行的,因此推論期間您不需要保持連線。
- 03
輪詢完成狀態
GET https://api.wavespeed.ai/api/v3/predictions/{request_id}/result。狀態為 completed 時回傳輸出;狀態為 failed、cancelled、timeout 或 deleted 時停止並回報錯誤;其他狀態則持續輪詢。
- 04
讀取輸出網址
當狀態為 "completed" 時,從 data.outputs[0] 讀取網址。該網址指向 WaveSpeedAI CDN 上您生成的媒體 — 依您呼叫的 Nano Banana 2 變體,可能是圖片、影片、音訊或 3D 檔案。
應用情境
您可以用 Nano Banana 2 打造什麼
開發者與創作者使用 Nano Banana 2 API 的常見工作流程。
多角色場景(最多 5 個)
目錄主打功能:單次生成最多可維持 5 個角色的一致性。適用於群像場景、團體產品照,以及需要讓多個主體保持可辨識度的敘事分鏡。
整合真實世界知識
目錄功能:可選用網頁搜尋與圖片搜尋參數,讓模型以當前真實世界的參考資料作為條件,當提示詞涉及特定地點、人物、品牌或事件時相當實用。
Flash 速度、Pro 品質
目錄定位為「Flash 速度的 Pro 品質圖像生成」,其價值在於接近 Nano Banana Pro 的畫質表現。
512px 至 4K 的解析度範圍
目錄說明:解析度範圍廣,從 512px(縮圖與行動裝置預覽用的低解析度)到 4K。請選擇能滿足交付需求的最小尺寸。
大量作業的 Fast 等級
google/nano-banana-2/text-to-image-fast 是 Nano Banana 2 中最便宜的選項,適合 A/B 測試管線與大量生成。Edit-fast 以相同價格提供修飾功能。
圖片編輯端點
google/nano-banana-2/edit 支援可輸出 4K 的進階圖片編輯,並能精準遵循指令。目錄說明支援圖片內文字的翻譯與在地化。
技巧
Nano Banana 2 提示詞技巧
讓 Nano Banana 2 產出更好結果的實用建議 — 整理自在實際生產流程中,圖片模型通用的有效做法。
- 01
以 5 角色一致性製作群像場景
目錄功能:「最多 5 個角色的一致性」。當提示詞中有多個主體必須保持可辨識時,Nano Banana 2 的角色一致性優於多數低價圖像模型,適合團體照、分鏡畫格與對話場景。
- 02
可選用的網頁搜尋與圖片搜尋
提供 enable_web_search 與 enable_image_search 參數。當提示詞涉及當前的真實地點、人物、品牌或事件時開啟,模型會依據檢索到的參考資料生成,而不只是依賴訓練資料。
- 03
512px 至 4K 的解析度範圍
目錄說明:「支援 512px 至 4K 解析度」。請選擇可接受的最小交付尺寸,適用於縮圖、行動裝置預覽,以及 4K 過度的大量作業。
- 04
用 Fast 等級進行迭代
google/nano-banana-2/text-to-image-fast 用於提示詞迭代與大量 A/B 測試;edit-fast 用於修飾。需要最佳畫質時再切換到 Standard 版本。
- 05
以 Edit 進行文字翻譯與在地化
目錄說明,編輯端點「支援圖片內的文字翻譯與在地化」。適合將行銷創意改編到不同市場,而無須重新生成整張圖片。
定價
Nano Banana 2 API 定價
依輸出計費。最終費用會依您在各變體 Playground 中設定的參數(解析度、時長、輸出數量、參考素材)而調整。
| 端點 | 類型 | 起始價格 |
|---|---|---|
| google/ | text-to-image | $0.045 |
| google/ | text-to-image | 10% OFF$0.07$0.063 |
| google/ | image-to-image | $0.045 |
| google/ | image-to-image | 10% OFF$0.07$0.063 |
| google/ | image-to-image | $0.04 |
| google/ | text-to-image | $0.04 |
API
呼叫 Nano Banana 2 API
請到 wavespeed.ai/accesskey 註冊取得 API 金鑰,然後透過 REST 提交 prediction。Playground 會為任何輸入組合產生可直接貼上的範例。
POSThttps://api.wavespeed.ai/api/v3/google/nano-banana-2/text-to-image
# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
-X POST "https://api.wavespeed.ai/api/v3/google/nano-banana-2/text-to-image" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $WAVESPEED_API_KEY" \
-d '{
"prompt": "A cinematic shot of a city at sunset, soft golden light",
"aspect_ratio": "1:1",
"resolution": "1k",
"enable_web_search": false,
"enable_image_search": false,
"output_format": "png"
}')
TASK=$(printf '%s' "$SUBMIT_RESPONSE" | jq 'if has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "$TASK" | jq -r '.id')
if [ -z "$PREDICTION_ID" ] || [ "$PREDICTION_ID" = "null" ]; then
printf 'Submission response did not contain a prediction id
' >&2
exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/$PREDICTION_ID/result"
# 2. Poll until the prediction finishes.
while true; do
RESPONSE=$(curl --silent --show-error --fail-with-body "$RESULT_URL" \
-H "Authorization: Bearer $WAVESPEED_API_KEY")
RESULT=$(printf '%s' "$RESPONSE" | jq 'if has("data") then .data else . end')
STATUS=$(printf '%s' "$RESULT" | jq -r '.status')
case "$STATUS" in
completed) printf '%s\n' "$RESULT" | jq '.outputs'; break ;;
failed|cancelled|timeout|deleted) printf '%s\n' "$RESULT" | jq . >&2; exit 1 ;;
*) sleep 2 ;;
esac
doneconst submitUrl = "https://api.wavespeed.ai/api/v3/google/nano-banana-2/text-to-image";
const apiKey = process.env.WAVESPEED_API_KEY;
if (!apiKey) throw new Error('Set WAVESPEED_API_KEY');
async function requestJson(url, options = {}) {
const response = await fetch(url, options);
if (!response.ok) throw new Error(await response.text());
return response.json();
}
// 1. Submit the prediction.
const body = await requestJson(submitUrl, {
method: "POST",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "A cinematic shot of a city at sunset, soft golden light",
"aspect_ratio": "1:1",
"resolution": "1k",
"enable_web_search": false,
"enable_image_search": false,
"output_format": "png"
}),
});
const task = body.data ?? body;
const resultUrl = `https://api.wavespeed.ai/api/v3/predictions/${task.id}/result`;
// 2. Poll until the prediction finishes.
while (true) {
const resultBody = await requestJson(resultUrl, {
headers: { "Authorization": `Bearer ${apiKey}` },
});
const result = resultBody.data ?? resultBody;
if (result.status === "completed") {
console.log(result.outputs);
break;
}
if (["failed", "cancelled", "timeout", "deleted"].includes(result.status)) throw new Error(JSON.stringify(result));
await new Promise(resolve => setTimeout(resolve, 2000));
}import json
import os
import time
from urllib.request import Request, urlopen
api_key = os.environ["WAVESPEED_API_KEY"]
headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
payload = {
"prompt": "A cinematic shot of a city at sunset, soft golden light",
"aspect_ratio": "1:1",
"resolution": "1k",
"enable_web_search": False,
"enable_image_search": False,
"output_format": "png"
}
def request_json(url, data=None):
request = Request(url, data=data, headers=headers, method="POST" if data else "GET")
with urlopen(request) as response:
return json.load(response)
# 1. Submit the prediction.
body = request_json("https://api.wavespeed.ai/api/v3/google/nano-banana-2/text-to-image", json.dumps(payload).encode())
task = body.get("data", body)
result_url = f"https://api.wavespeed.ai/api/v3/predictions/{task['id']}/result"
# 2. Poll until the prediction finishes.
while True:
result_body = request_json(result_url)
result = result_body.get("data", result_body)
status = result.get("status")
if status == "completed":
print(result.get("outputs", []))
break
if status in {"failed", "cancelled", "timeout", "deleted"}:
raise RuntimeError(result)
time.sleep(2)比較
Nano Banana 2 與其他選擇比較
在 WaveSpeedAI 上,何時該選擇 Nano Banana 2 而非類似的模型。
Nano Banana 2 vs Nano Banana Pro
Pro 涵蓋 4K 文字轉圖片、編輯、Ultra 等級與專用的 Multi 版本。Nano Banana 2 是更便宜、更快的版本,具備 Pro 所沒有的多角色一致性與網頁搜尋整合。
Nano Banana 2 vs GPT Image 2
GPT Image 2 提供明確的品質等級(low/medium/high)與以參考圖編輯的工作流程。Nano Banana 2 則在最多 5 個角色的一致性,以及可選用的網頁/圖片搜尋(真實世界知識)上勝出。
Nano Banana 2 vs Seedream 5 Lite
Seedream 5 Lite 著重字體排版,並提供 Sequential 版本以維持多張圖片的一致性。Nano Banana 2 價格略高,但包含 Seedream 所沒有的、以網頁搜尋為依據的生成。
常見問題
Nano Banana 2 API — 常見問題
定價、授權、整合 — 關於在 WaveSpeedAI 上執行 Nano Banana 2 的常見問題。
什麼是 Nano Banana 2 API?
Nano Banana 2 是 Google 的圖片生成模型,在 WaveSpeedAI 上以 REST API 提供。Google Nano Banana 2(Gemini 3.1 Flash Image)以 Flash 的速度提供 Pro 品質的圖像生成。解析度範圍從 512px 到 4K,文字渲染更佳,最多可維持 5 個角色的一致性,並整合真實世界知識。您可以透過程式呼叫,也可以在上方連結的 Playground 試用。
如何呼叫 Nano Banana 2 API?
註冊 WaveSpeedAI 帳號,從 /accesskey 複製您的 API 金鑰,然後將您的輸入以 JSON 格式 POST 到 https://api.wavespeed.ai/api/v3/google/nano-banana-2/text-to-image。端點會回傳 prediction id。請從約每 2 秒輪詢一次結果端點開始,長時間任務可拉長間隔,並在任何終止狀態時停止。上方提供適用於生產環境的 Python / Node.js / cURL 範例。
Nano Banana 2 API 的費用是多少?
Nano Banana 2 $0.04 起。實際費用會依您設定的參數(解析度、時長、輸出數量、參考素材)而調整。Playground 中「生成」按鈕旁的即時費用預覽會顯示您目前輸入的確切價格。
有哪些 Nano Banana 2 變體可用?
WaveSpeedAI 提供 6 個已上線的 Nano Banana 2 端點:google/nano-banana-2/text-to-image-fast, google/nano-banana-2/text-to-image, google/nano-banana-2/edit-fast, google/nano-banana-2/edit, google/nano-banana-2-lite/edit, google/nano-banana-2-lite/text-to-image。每個變體都有各自的 Playground 頁面與定價。
Nano Banana 2 的輸出可以商用嗎?
商業使用權依 Google 的模型授權而定。多數 Google 模型允許商用輸出;請參閱各模型 Playground 頁面中的授權摘要,以及 WaveSpeedAI 的服務條款了解平台層級的條件。
為什麼要在 WaveSpeedAI 上使用 Nano Banana 2,而不是直接使用?
一組 API 金鑰、一個帳單帳戶,即可使用 Nano Banana 2 以及來自其他供應商的 1,000+ 個 AI 模型。無需設定各家 SDK、無需處理各自獨立的速率限制、無需為每個供應商重寫整合程式碼。價格通常與 Google 的直接 API 相當或更低。
提供者
關於 Google
Nano Banana 2 背後的團隊,以及 Google 在 WaveSpeedAI 上的完整模型陣容。
Google 的 AI 研究主要在 Google DeepMind 與 Google Research 進行。其圖像與影片模型,包括 Imagen、Veo,以及 Nano Banana(Gemini 3 Image)等 Gemini 系列多模態模型,與整個 Gemini 產品線共用架構與訓練基礎設施。輸出以準確的文字渲染、廣泛的風格涵蓋與商用等級授權見長。
在 WaveSpeedAI 上開始使用 Nano Banana 2 打造應用
註冊即贈免費入門點數。一組 API 金鑰,涵蓋來自 Google 與所有其他供應商的 1,000+ 個 AI 模型。
/filters:quality(82)/examples/c6f2756b2e28edb48fb6fb0d93eb72d4/1783682990942779875_9zyIR19j.webp)
/filters:quality(82)/examples/b49a206e5418f7c28c781c906018e3f5/1783682980959071421_Nk3dnwFP.webp)
/filters:quality(82)/examples/e8042eb4959f101afb95527f0bb8c5f6/1783682985305526491_RyyIS1ak.webp)
/filters:quality(82)/examples/7fa7017e74606377a701e2ea6f54932b/1783682988891734970_MaV4eoyH.webp)