探索這款次世代 AI 模型的先進功能——包含思考能力、搜尋定錨(search grounding)、以及令人驚豔的 4K 輸出——讓你能打造更複雜與更具創造力的應用程式。
Flash 版本(Nano Banana)帶來速度與低成本,而 Pro 版本則加入了「思考」能力、搜尋定錨,以及高保真 4K 輸出。準備好用 Nano Banana Pro 挑戰更複雜的創意任務吧!
本指南將透過 Gemini Developer API 帶你完整了解 Nano Banana Pro 的進階功能。
本指南將介紹:
-
在 Google AI Studio 使用 Nano Banana Pro
-
專案設定
-
初始化 Client
-
基礎生成(經典功能)
-
「思考」流程
-
搜尋定錨(Search Grounding)
-
高解析度 4K 生成
-
多語能力
-
進階圖片混合
-
Pro 限定示範
-
最佳實務與提示技巧
備註:若你想要本篇的互動版,可查看 Python cookbook 或 AI Studio 的 Javascript Notebook。
1. 在 Google AI Studio 使用 Nano Banana Pro
一般使用者可以在 Gemini App 中使用 Nano Banana Pro,但對開發者來說,Google AI Studio 是最適合用來原型開發與測試提示的環境。
AI Studio 是一個讓你在寫任何程式碼之前先「試玩所有可用模型」的完整 Playground,也是使用 Gemini API 的起點。
你可以在 AI Studio 中使用 Nano Banana Pro。
開始方式如下:
前往 aistudio.google.com → 使用 Google 帳號登入 → 在模型選單中選擇 Nano Banana Pro(Gemini 3 Pro Image)。
與 Nano Banana 不同,Pro 版本 沒有免費額度,因此必須使用「已啟用計費的 API key」(請參見下方「專案設定」)。

小提示:
你也可以在 ai.studio/apps 直接進行 Nano Banana Web App 的「vibe coding」,或瀏覽與 Remix 現有的 App。
2. 專案設定
跟著本指南,你需要準備以下項目:
-
Google AI Studio 的 API key
-
專案已啟用計費
-
Google Gen AI SDK(Python 或 JavaScript/TypeScript)
如果你已經是 Hardcore Gemini API 使用者,那麼你可以跳過這段。否則,以下是開始方式:
Step A:取得 API Key
首次登入 AI Studio 時,系統會自動建立一個 Google Cloud 專案與 API key。
打開 API Key 管理頁面,點擊「複製」圖示即可複製你的 API key。

Step B:啟用計費
Nano Banana Pro 無免費額度,因此你必須替 Google Cloud 專案啟用計費。
在 API Key 管理頁面中,點擊專案旁的「Set up billing」並依照畫面指示進行。

Nano Banana Pro 多少錢?
Nano Banana Pro 的圖片生成比 Flash 版本更昂貴,尤其是 4K 圖片。
以本指南撰寫當下的價格為例:
| 圖片尺寸 | 單張價格 |
|---|---|
| 1K / 2K | $0.134 |
| 4K | $0.24(另加輸入文字 token 與輸出文字 token 費用) |
請查閱官方文件以取得最新價格。
Pro Tip:
你可以使用 Batch API 節省 50% 的生成費用,但圖片可能要等最多 24 小時才會產生完成。
Step C:安裝 SDK
你可以選擇想使用的語言:
Python
pip install -U google-genai
# 安裝 Pillow 進行圖片處理
pip install Pillow
JavaScript / TypeScript
npm install @google/genai
本指南示範使用 Python SDK。等效的 JavaScript 代碼請參考 JS Notebook。
3. 初始化 Client
要使用 Pro 模型,你需要使用模型 ID:
gemini-3-pro-image-preview
from google import genai from google.genai import types # 初始化 client client = genai.Client(api_key="YOUR_API_KEY") # 模型 ID PRO_MODEL_ID = "gemini-3-pro-image-preview"
4. 基礎生成(經典案例)
在認識進階功能前,先來看基本圖片生成。
你可以使用 response_modalities(輸出文字 + 圖片,或只輸出圖片)以及 aspect_ratio 控制輸出。
prompt = "Create a photorealistic image of a siamese cat with a green left eye and a blue right one"
aspect_ratio = "16:9"
response = client.models.generate_content(
model=PRO_MODEL_ID,
contents=prompt,
config=types.GenerateContentConfig(
response_modalities=['Text', 'Image'],
image_config=types.ImageConfig(
aspect_ratio=aspect_ratio,
)
)
)
# 儲存圖片
for part in response.parts:
if image := part.as_image():
image.save("cat.png")

5. 「思考」流程
Nano Banana Pro 不只是畫圖,它會「思考」。
它能在生成圖片前理解並推理你的複雜提示。最棒的是:
你可以看到它的思考過程!
只要在 thinking_config 中加入 include_thoughts=True。
prompt = "Create an unusual but realistic image that might go viral"
aspect_ratio = "16:9"
response = client.models.generate_content(
model=PRO_MODEL_ID,
contents=prompt,
config=types.GenerateContentConfig(
response_modalities=['Text', 'Image'],
image_config=types.ImageConfig(
aspect_ratio=aspect_ratio,
),
thinking_config=types.ThinkingConfig(
include_thoughts=True
)
)
)
示例輸出:
## Imagining Llama Commuters
I'm focusing on the llamas now. The goal is to capture them as
daily commuters on a bustling bus in La Paz, Bolivia. My plan
involves a vintage bus crammed with amused passengers. The image
will highlight details like one llama looking out the window,
another interacting with a passenger, all while people take
photos.
[IMAGE]
## Visualizing the Concept
I'm now fully immersed in the requested scenario. My primary
focus is on the "unusual yet realistic" aspects. The scene is
starting to take shape with the key elements established.

這讓你能深入理解模型如何解讀你的請求,就像是與你的藝術家對話!
6. 搜尋定錨(Search Grounding:即時網路資料)
Nano Banana Pro 的絕招之一,就是可以使用 Google Search 查詢即時資訊,再以此生成最新、準確的圖片。
例如,你可以請它生成東京未來五天的天氣圖表:
prompt = "Visualize the current weather forecast for the next 5 days in Tokyo..."
response = client.models.generate_content(
model=PRO_MODEL_ID,
contents=prompt,
config=types.GenerateContentConfig(
response_modalities=['Text', 'Image'],
image_config=types.ImageConfig(aspect_ratio="16:9"),
tools=[{"google_search": {}}]
)
)
並可取得來源(一定要列出來源):
print(response.candidates[0].grounding_metadata.search_entry_point.rendered_content)

7. Go Big or Go Home:4K 超高解析度生成
需要印刷級圖片?
Nano Banana Pro 支援 4K 輸出。

注意:4K 生成成本較高,請謹慎使用!
8. Polyglot Banana(多語能力)
此模型能在圖片中生成並翻譯多語文字(10 多種語言)。
它簡直是你的視覺版全語系翻譯器。
生成圖片(西班牙語)
# Generate an infographic in Spanish
message = "Make an infographic explaining Einstein's theory of General Relativity suitable for a 6th grader in Spanish"
response = chat.send_message(message,
config=types.GenerateContentConfig(
image_config=types.ImageConfig(aspect_ratio="16:9")
)
)
# Save the image
for part in response.parts:
if image:= part.as_image():
image.save("relativity.png")

# Translate it to Japanese
message = "Translate this infographic in Japanese, keeping everything else the same"
response = chat.send_message(message)
# Save the image
for part in response.parts:
if image:= part.as_image():
image.save("relativity_JP.png")

9. 進階圖片混合(最多 14 張!)
Flash 模型最多混合 3 張圖片,
Pro 模型一次可以混合 14 張,非常適合同場景角色合成、產品系列展示等。
response = client.models.generate_content(
model=PRO_MODEL_ID,
contents=[
"An office group photo...",
PIL.Image.open('John.png'),
PIL.Image.open('Jane.png'),
# ...最多 14 張
],
)
若你要角色還原度很高,建議限制在 5 張 以內。
10. Pro 限定示範(Showtime!)
以下是只有 Nano Banana Pro 才能做到的效果:
例:個人化像素藝術(含網路搜尋)
Prompt:
「Search the web then generate isometric pixel art that shows the career of Guillaume Vernade」

例:複雜文本整合
可將長篇內容完美融入資訊圖表。

例:高保真 Mockup
製作劇院節目冊、雜誌封面等超逼真場景。

11. Nano Banana / Nano Banana Pro 最佳實務與提示技巧
使用這兩款模型時,請注意以下要點:
✔ 越具體越好
角色、光線、構圖、色彩、鏡頭……越詳細控制越強。
✔ 告訴模型你的目的
例如:「用於海報」、「要很溫暖、適合兒童」等。
✔ 逐步指示(Step-by-step)
複雜場景拆成多段說明 → 效果會更好。
✔ 使用正面描述
不要說「不要車子」,
請說:「寧靜無車的空曠街道」。
✔ 控制鏡頭語法
如:「wide angle」「macro」「low-angle」。
✔ 善用搜尋定錨
要使用真實世界資訊時,一定要明確說明。
✔ 用 Batch API 降成本 + 擴大額度
價格省 50%,但可能需等最多 24H。
結語
Nano Banana Pro(Gemini 3 Pro Image)開啟了全新的 AI 圖像生成時代。
具備「思考」、「即時搜尋」、「4K 生成」三大能力,
它是專業創作者的強大工具——也是超級有趣的玩具。
準備開始了嗎?
前往 Google AI Studio,試試看官方 Apps,
或動手玩玩 cookbook 吧!