Nano Banana 2

Nano Banana 2 是一款圖片生成模型,主要能力包括0.5K、4K、Gemini-compatible、OpenAI-compatible、圖片編輯。它適合創意探索、產品視覺、行銷素材,以及需要穩定 API 串接的自動化內容工作流程。你可以在下方試驗場中使用具代表性的提示詞與輸入素材,調整本頁提供的參數,查看模型在真實業務情境中的生成效果。正式串接前,建議結合自己的任務比較輸出品質、主體一致性、處理時間、失敗處理方式與預估成本。具體可用的輸入方式、參數範圍與輸出選項以目前頁面為準。

A luminous stream of landscape and nature images moving through transparent blue and violet arcs
模型識別碼
nano-banana-2
供應商
Google
API 端點
/v1/images/generations
計費
0.029411764706
更新時間
2026-09-11

能力

  • 透過目前公開端點生成圖片
  • 即時 Schema 提供時支援圖片編輯或參考圖控制
  • 目前參數包括 prompt, images, resolution

限制

  • 模型能力與參數範圍可能更新,正式環境應鎖定並驗證使用的參數組合
  • 未出現在即時 Request Schema 中的參數不應假定可用
  • 非同步任務需要處理輪詢、失敗、逾時與內容安全狀態

典型情境

  • 產品原型與自動化內容工作流程
  • 批次媒體生成與程式化創作
  • 需要統一驗證、計費與呼叫記錄的多模型應用

價格與計費範例

  • 0.5K image | 0.029411764706 | output_images | {"resolution_tier":"0.5k"}
  • 1K image | 0.029411764706 | output_images | {"resolution_tier":"1k"}
  • 2K image | 0.044117647059 | output_images | {"resolution_tier":"2k"}
  • 4K image | 0.058823529412 | output_images | {"resolution_tier":"4k"}

請求參數

參數類型必填預設值可選值
modelstring
prompttextarea
imagesasset_list
resolutionselect1k0.5k, 1k, 2k, 4k
aspect_ratioselect1:11:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
ninteger1
output_formatselectpngpng

API 串接範例

cURL

curl -X POST 'https://api.uniall.ai/v1/images/generations' \
  -H 'Authorization: Bearer $UNIALL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"aspect_ratio":"1:1","model":"nano-banana-2","n":1,"output_format":"png","prompt":"Describe the output you want","resolution":"1k"}'

Python

import json
import requests

payload = json.loads(r'''{"aspect_ratio":"1:1","model":"nano-banana-2","n":1,"output_format":"png","prompt":"Describe the output you want","resolution":"1k"}''')
response = requests.post(
    "https://api.uniall.ai/v1/images/generations",
    headers={"Authorization": "Bearer " + UNIALL_API_KEY},
    json=payload,
)
response.raise_for_status()
result = response.json()

JavaScript

const response = await fetch("https://api.uniall.ai/v1/images/generations", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.UNIALL_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"aspect_ratio":"1:1","model":"nano-banana-2","n":1,"output_format":"png","prompt":"Describe the output you want","resolution":"1k"}),
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const result = await response.json();

常見問題

nano-banana-2 的 API 端點是甚麼?

端點會依目前模型能力與 Request Schema 自動解析,並顯示於本頁 API 區域。

nano-banana-2 如何計費?

價格區域直接讀取目前的結構化計費設定;改價後不需要重寫本文。

可以使用 Python 串接嗎?

可以。本頁範例使用目前端點與原始模型程式碼識別碼。

是否提供 JavaScript 與 cURL 範例?

提供。三種範例共用同一個即時請求結構。

支援哪些解析度、時長或參考圖參數?

支援範圍取決於目前 Request Schema,未顯示的欄位不應假定可用。

正式環境串接時要注意甚麼?

請驗證參數、逾時、錯誤處理與非同步生成任務狀態,並在模型更新後重新執行小範圍測試。