nano-banana-use
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNano Banana Use
Nano Banana 使用说明
Use this skill to generate, edit, and compose images using Gemini's Nano Banana models ( and ).
gemini-2.5-flash-imagegemini-3-pro-image-previewThis skill uses portable Python scripts managed by .
uv使用该技能可通过Gemini的Nano Banana模型(和)生成、编辑和合成图片。
gemini-2.5-flash-imagegemini-3-pro-image-preview该技能使用由管理的可移植Python脚本。
uvPrerequisites
前置条件
Ensure you have one of the following authentication methods configured in your environment:
-
API Key:
- or
GOOGLE_API_KEYGEMINI_API_KEY
-
Vertex AI:
GOOGLE_CLOUD_PROJECTGOOGLE_CLOUD_LOCATIONGOOGLE_GENAI_USE_VERTEXAI=1
请确保你的环境中已配置以下身份验证方式之一:
-
API Key:
- 或
GOOGLE_API_KEYGEMINI_API_KEY
-
Vertex AI:
GOOGLE_CLOUD_PROJECTGOOGLE_CLOUD_LOCATIONGOOGLE_GENAI_USE_VERTEXAI=1
Usage
使用方法
Generate an Image
生成图片
Step 1: Confirm Parameters
Before running the script, confirm the following parameters with the user or state the defaults you will use:
- Prompt: The image description.
- Model: Default is .
gemini-3-pro-image-preview - Aspect Ratio: Default is .
1:1 - Safety Filter: Default is .
BLOCK_MEDIUM_AND_ABOVE
Step 2: Run the Script
Run the python script using :
uvbash
uv run skills/nano-banana-use/scripts/generate_image.py "A futuristic banana city" --output city.png步骤1:确认参数
运行脚本前,请与用户确认以下参数,或说明你将使用的默认参数:
- Prompt:图片描述。
- Model:默认值为。
gemini-3-pro-image-preview - 宽高比:默认值为。
1:1 - 安全过滤器:默认值为。
BLOCK_MEDIUM_AND_ABOVE
步骤2:运行脚本
使用运行Python脚本:
uvbash
uv run skills/nano-banana-use/scripts/generate_image.py "A futuristic banana city" --output city.pngEdit an Image
编辑图片
Modify an existing image based on a text prompt.
bash
uv run skills/nano-banana-use/scripts/edit_image.py original.png "Make the sky purple" --output edited.png根据文本提示修改现有图片。
bash
uv run skills/nano-banana-use/scripts/edit_image.py original.png "Make the sky purple" --output edited.pngCompose Images
合成图片
Generate a new image based on multiple input images and a prompt.
bash
uv run skills/nano-banana-use/scripts/compose_image.py --image style.png --image subject.jpg "A painting of the subject in the style of the first image" --output composition.png根据多张输入图片和提示生成新图片。
bash
uv run skills/nano-banana-use/scripts/compose_image.py --image style.png --image subject.jpg "A painting of the subject in the style of the first image" --output composition.pngOptions
可选参数
- : The text description of the image.
prompt - : The model to use. Defaults to
--model.gemini-3-pro-image-preview - : The filename for the saved image. Defaults to
--output.generated_image.png - : The aspect ratio of the generated image. Defaults to
--aspect-ratio. Supported:1:1,1:1,16:9,4:3,3:4.9:16 - : Safety filter threshold. Defaults to
--safety-filter-level.BLOCK_MEDIUM_AND_ABOVE
- :图片的文本描述。
prompt - :要使用的模型,默认值为
--model。gemini-3-pro-image-preview - :保存图片的文件名,默认值为
--output。generated_image.png - :生成图片的宽高比,默认值为
--aspect-ratio,支持的选项包括:1:1、1:1、16:9、4:3、3:4。9:16 - :安全过滤器阈值,默认值为
--safety-filter-level。BLOCK_MEDIUM_AND_ABOVE