Nano Banana官方提示詞來了,附完整代碼示例
Nano banana正火爆全球,谷歌立馬推出官方提示詞指南。

下面先進行一些效果展示,看看它的強大之處。
借助Nano-banana、Seedance和Kling,梵高、蒙娜麗莎、戴珍珠耳環(huán)的少女都能在紐約中央公園里合照。

不僅如此,還能生成十分炫酷的動畫視頻。

甚至能毫無痕跡的換臉?!

好家伙,香蕉這波真是讓我開眼了。感覺官方再不出教程,網友們自己都能搞個“百科全書”了。
正值香蕉熱度爆棚之際,谷歌總結其5大核心功能,助你輕松玩轉這一創(chuàng)新工具。
- 文本轉圖像:從文本描述生成高質量圖像。
- 圖像+文本轉圖像(編輯):可通過文本提示對圖像進行添加、刪除或修改元素,還能改變風格和調整色彩。
- 多圖像到圖像(構圖和風格轉換):使用多張輸入圖像來組成一個新場景或將風格從一張圖像轉換到另一張圖像。
- 迭代細化:可通過多次對話逐步微調圖像,直至完美。
- 高保真文本渲染:準確生成清晰且布局合理的文字圖像,適用于 logo、圖表和海報等。
谷歌還特別提示了,描述場景,不要僅僅列出關鍵詞。
相比簡單、不連貫的關鍵詞列表,一段敘事性強、描述詳細的段落通常能生成更好、更連貫的圖像。
對于此指導,網友可謂十分喜歡。

下面讓我們一起看看具體提示詞是什么樣的。
6類Nano banana提示詞
生成圖像最常見的方法,就是告訴它你想看什么。
先看看官方生成的圖片,貓貓在雙子座星空下的豪華餐廳里吃香蕉。

哇哦,貓貓桌子上還擺著刀叉和酒杯,餐廳里其他桌子上也有客人,真是充滿了細節(jié)。
如果你也想用納米香蕉生成如此驚艷的效果,就一起來學學谷歌的6大類提示詞吧。
逼真的場景
要獲得逼真的圖像,最好像攝影師一樣思考。提及相機角度、鏡頭類型、光線和精細細節(jié),這將使模型達到最逼真的效果。
通用提示如下所示:
A photorealistic [shot type] of [subject], [action or expression], set in [environment]. The scene is illuminated by [lighting description], creating a [mood] atmosphere. Captured with a [camera/lens details], emphasizing [key textures and details]. The image should be in a [aspect ratio] format.
不僅如此,谷歌還特意給出了API代碼。
1from google import genai
2from google.genai import types
3from PIL import Image
4from io import BytesIO
5
6client = genai.Client()
7
8# Generate an image from a text prompt
9response = client.models.generate_content(
10 model="gemini-2.5-flash-image-preview",
11 cnotallow="A photorealistic close-up portrait of an elderly Japanese ceramicist with deep, sun-etched wrinkles and a warm, knowing smile. He is carefully inspecting a freshly glazed tea bowl. The setting is his rustic, sun-drenched workshop with pottery wheels and shelves of clay pots in the background. The scene is illuminated by soft, golden hour light streaming through a window, highlighting the fine texture of the clay and the fabric of his apron. Captured with an 85mm portrait lens, resulting in a soft, blurred background (bokeh). The overall mood is serene and masterful.",
12)
13
14image_parts = [
15 part.inline_data.data
16 for part in response.candidates[0].content.parts
17 if part.inline_data
18]
19
20if image_parts:
21 image = Image.open(BytesIO(image_parts[0]))
22 image.save('photorealistic_example.png')
23 image.show()以下為官方生成的一位老年陶瓷藝術家的特寫。

柔和的金色陽光透過窗戶灑進畫面,照亮了陶土的細膩質感和老人臉上的皺紋。
風格化的插圖和貼紙
如果你想為項目創(chuàng)建貼紙、圖標或其他素材,務必明確指定風格,并在需要時要求使用白色背景。
A [style] sticker of a [subject], featuring [key characteristics] and a [color palette]. The design should have [line style] and [shading style]. The background must be white.
1from google import genai
2from google.genai import types
3from PIL import Image
4from io import BytesIO
5
6client = genai.Client()
7
8# Generate an image from a text prompt
9response = client.models.generate_content(
10 model="gemini-2.5-flash-image-preview",
11 cnotallow="A photorealistic close-up portrait of an elderly Japanese ceramicist with deep, sun-etched wrinkles and a warm, knowing smile. He is carefully inspecting a freshly glazed tea bowl. The setting is his rustic, sun-drenched workshop with pottery wheels and shelves of clay pots in the background. The scene is illuminated by soft, golden hour light streaming through a window, highlighting the fine texture of the clay and the fabric of his apron. Captured with an 85mm portrait lens, resulting in a soft, blurred background (bokeh). The overall mood is serene and masterful.",
12)
13
14image_parts = [
15 part.inline_data.data
16 for part in response.candidates[0].content.parts
17 if part.inline_data
18]
19
20if image_parts:
21 image = Image.open(BytesIO(image_parts[0]))
22 image.save('photorealistic_example.png')
23 image.show()以下為一張卡哇伊風格的快樂小熊貼紙。

背景為設定的白色,整體采用清晰輪廓和大膽配色,整個設計十分生動和吸引人。
圖像中的準確文本
在渲染文本時,需具體描述文本內容、字體風格,以及整體設計。
Create a [image type] for [brand/concept] with the text “[text to render]” in a [font style]. The design should be [style description], with a [color scheme].
1from google import genai
2from google.genai import types
3from PIL import Image
4from io import BytesIO
5
6client = genai.Client()
7
8# Generate an image from a text prompt
9response = client.models.generate_content(
10 model="gemini-2.5-flash-image-preview",
11 cnotallow="Create a modern, minimalist logo for a coffee shop called 'The Daily Grind'. The text should be in a clean, bold, sans-serif font. The design should feature a simple, stylized icon of a a coffee bean seamlessly integrated with the text. The color scheme is black and white.",
12)
13
14image_parts = [
15 part.inline_data.data
16 for part in response.candidates[0].content.parts
17 if part.inline_data
18]
19
20if image_parts:
21 image = Image.open(BytesIO(image_parts[0]))
22 image.save('logo_example.png')
23 image.show()以下是為名為“The Daily Grind”的咖啡店創(chuàng)建的一個現(xiàn)代簡約風格的標志。

此圖整體采用黑白風格,中間的咖啡豆圖標成為了整個設計的焦點,非常符合咖啡店的品牌形象。
產品模型和商業(yè)攝影
納米香蕉還能為電子商務、廣告或品牌創(chuàng)建清晰、專業(yè)的產品照片。
A high-resolution, studio-lit product photograph of a [product description] on a [background surface/description]. The lighting is a [lighting setup, e.g., three-point softbox setup] to [lighting purpose]. The camera angle is a [angle type] to showcase [specific feature]. Ultra-realistic, with sharp focus on [key detail]. [Aspect ratio].
1from google import genai
2from google.genai import types
3from PIL import Image
4from io import BytesIO
5
6client = genai.Client()
7
8# Generate an image from a text prompt
9response = client.models.generate_content(
10 model="gemini-2.5-flash-image-preview",
11 cnotallow="A high-resolution, studio-lit product photograph of a minimalist ceramic coffee mug in matte black, presented on a polished concrete surface. The lighting is a three-point softbox setup designed to create soft, diffused highlights and eliminate harsh shadows. The camera angle is a slightly elevated 45-degree shot to showcase its clean lines. Ultra-realistic, with sharp focus on the steam rising from the coffee. Square image.",
12)
13
14image_parts = [
15 part.inline_data.data
16 for part in response.candidates[0].content.parts
17 if part.inline_data
18]
19
20if image_parts:
21 image = Image.open(BytesIO(image_parts[0]))
22 image.save('product_mockup.png')
23 image.show()以下為一張高分辨率、工作室燈光下的簡約陶瓷咖啡杯產品照片。

此圖可以清晰地看到杯內升起的蒸汽,整體線條簡約,畫面極其逼真。
極簡主義和空間設計
它還非常適用于創(chuàng)建網站、演示文稿或營銷材料的背景,并在這些背景上覆蓋文本加以修飾。
A minimalist composition featuring a single [subject] positioned in the [bottom-right/top-left/etc.] of the frame. The background is a vast, empty [color] canvas, creating significant negative space. Soft, subtle lighting. [Aspect ratio].
1from google import genai
2from google.genai import types
3from PIL import Image
4from io import BytesIO
5
6client = genai.Client()
7
8# Generate an image from a text prompt
9response = client.models.generate_content(
10 model="gemini-2.5-flash-image-preview",
11 cnotallow="A minimalist composition featuring a single, delicate red maple leaf positioned in the bottom-right of the frame. The background is a vast, empty off-white canvas, creating significant negative space for text. Soft, diffused lighting from the top left. Square image.",
12)
13
14image_parts = [
15 part.inline_data.data
16 for part in response.candidates[0].content.parts
17 if part.inline_data
18]
19
20if image_parts:
21 image = Image.open(BytesIO(image_parts[0]))
22 image.save('minimalist_design.png')
23 image.show()以下是一張極簡主義構圖,右下角以一片精致的紅色楓葉為特色。

連環(huán)畫(漫畫面板/故事板)
通過清晰的場景描述,逐幀創(chuàng)建引人入勝的視覺敘事,特別適合制作故事板、漫畫或任何形式的連環(huán)畫。
A single comic book panel in a [art style] style. In the foreground, [character description and action]. In the background, [setting details]. The panel has a [dialogue/caption box] with the text “[Text]”. The lighting creates a [mood] mood. [Aspect ratio].
1from google import genai
2from google.genai import types
3from PIL import Image
4from io import BytesIO
5
6client = genai.Client()
7
8# Generate an image from a text prompt
9response = client.models.generate_content(
10 model="gemini-2.5-flash-image-preview",
11 cnotallow="A single comic book panel in a gritty, noir art style with high-contrast black and white inks. In the foreground, a detective in a trench coat stands under a flickering streetlamp, rain soaking his shoulders. In the background, the neon sign of a desolate bar reflects in a puddle. A caption box at the top reads \"The city was a tough place to keep secrets.\" The lighting is harsh, creating a dramatic, somber mood. Landscape.",
12)
13
14image_parts = [
15 part.inline_data.data
16 for part in response.candidates[0].content.parts
17 if part.inline_data
18]
19
20if image_parts:
21 image = Image.open(BytesIO(image_parts[0]))
22 image.save('comic_panel.png')
23 image.show()以下是一幅黑色藝術風格的漫畫書面板。

此漫畫中,主人公身穿風衣站在路燈下,背景中,一家荒涼酒吧的燈牌映照在水中,整體充滿了濃厚的隱秘與危險氛圍。
這些提示詞指南和效果展示難道還沒有引起你的興趣嗎?
心動不如行動,趕緊去體驗一下這項創(chuàng)新技術的強大吧~





































