Nano Banana
Endpoint: POST https://vod.intl.tencentcloudapi.comAction: CreateAigcImageTask
Nano Banana 是图片生成模型,支持文生图与多图参考生成 / 编辑(3.6 / 3.1 最多可传入 14 张参考图)。输出分辨率 1K~4K;最新版本 3.6(Nano Banana 2.1)新增 1:8 / 8:1 等超宽比例,3.1-lite 适合追求速度的场景。
基本信息
| 项目 | 值 |
|---|---|
| ModelName | GEM |
| ModelVersion | 3.6 / 3.1 / 3.1-lite / 3.0 / 2.5 |
| 默认值 | ModelVersion=3.1 / AspectRatio=1:1 |
| 护栏解除支持 | 不支持 |
各版本支持规格
| 版本 | 对应模型 | 最大参考图 | 分辨率 | 宽高比 |
|---|---|---|---|---|
3.6 | Nano Banana 2.1 | 14 张(其中角色图最多 4 张) | 1K / 2K / 4K | 1:1 / 1:4 / 1:8 / 2:3 / 3:2 / 3:4 / 4:1 / 4:3 / 4:5 / 5:4 / 8:1 / 9:16 / 16:9 / 21:9 |
3.1 | Nano Banana 2 | 14 张 | 1K / 2K / 4K | 同 3.6 |
3.1-lite | Nano Banana 2 Lite | 14 张 | 1K / 2K / 4K | 同 3.6 |
3.0 | Nano Banana Pro | 14 张 | 1K / 2K / 4K | 1:1 / 2:3 / 3:2 / 3:4 / 4:1 / 4:3 / 4:5 / 5:4 / 9:16 / 16:9 / 21:9 |
2.5 | Nano Banana | 3 张 | 1K / 2K / 4K | 同 3.0 |
所有版本均支持文生图、参考生图与图片编辑。
请求参数
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
ModelName | 必填 | String | 固定值 GEM |
ModelVersion | 可选 | String | 3.6 / 3.1 / 3.1-lite / 3.0 / 2.5 |
Prompt | 必填 | String | 生成提示词 |
FileInfos.N | 可选 | Array | 参考图片(image-to-image)。Category 为 Image。张数上限见上表 |
OutputConfig.Resolution | 可选 | String | 1K / 2K / 4K |
OutputConfig.AspectRatio | 可选 | String | 1:1 / 16:9 / 9:16 / 4:3 / 3:4 等,各版本可选值见上表 |
OutputConfig.OutputImageCount | 可选 | Integer | 生成张数(各模型上限不同) |
ExtInfo | 可选 | String | 扩展参数。可通过 thinkingLevel 自定义思考等级:minimal / medium / high,默认 medium |
请求示例
3.6 / 文生图
json
{
"SubAppId": 123456789,
"ModelName": "GEM",
"ModelVersion": "3.6",
"Prompt": "an artist in a bunny costume copies the image on her monitor onto a canvas as an oil painting; the photo itself captures her painting this recursive image",
"OutputConfig": {
"StorageMode": "Temporary",
"Resolution": "1K",
"AspectRatio": "9:16"
},
"SessionContext": "gem36-t2i-001"
}3.6 / 多图融合
json
{
"SubAppId": 123456789,
"ModelName": "GEM",
"ModelVersion": "3.6",
"FileInfos": [
{
"Type": "Url",
"Category": "Image",
"Url": "https://<host>/image-1.png"
},
{
"Type": "Url",
"Category": "Image",
"Url": "https://<host>/image-2.png"
}
],
"Prompt": "Blend image 1 and image 2 into a single coherent scene.",
"OutputConfig": {
"StorageMode": "Temporary",
"Resolution": "2K",
"AspectRatio": "16:9"
},
"SessionContext": "gem36-i2i-001"
}3.1 / 文生图
json
{
"SubAppId": 123456789,
"ModelName": "GEM",
"ModelVersion": "3.1",
"Prompt": "a serene japanese garden, soft morning light",
"OutputConfig": {
"AspectRatio": "1:1",
"OutputImageCount": 1,
"StorageMode": "Temporary"
},
"SessionContext": "job-001"
}参考图片请求
json
{
"SubAppId": 123456789,
"ModelName": "GEM",
"ModelVersion": "3.1",
"Prompt": "Change the background to a quiet garden; preserve the subject.",
"OutputConfig": {
"AspectRatio": "1:1",
"OutputImageCount": 1,
"StorageMode": "Temporary"
},
"SessionContext": "job-001",
"FileInfos": [
{
"Type": "Url",
"Category": "Image",
"Url": "https://<host>/reference.jpg"
}
]
}响应示例
json
{
"AigcImageTask": {
"Status": "FINISH",
"ErrCode": 0,
"Progress": 100,
"Output": {
"FileInfos": [
{
"FileUrl": "http://<host>.vod2.myqcloud.com/.../aigcImageGenFile.png",
"ExpireTime": "2026-08-01T10:29:48Z",
"MetaData": {
"Width": 1024,
"Height": 1024,
"Container": "png"
}
}
]
}
}
}特殊设置
附加选项
Google Gemini Image 系列
支持文本→图片生成与参考图片生成(i2i)。
自定义思考等级(thinkingLevel)
通过 ExtInfo.AdditionalParameters.thinkingLevel 调整模型生成前的推理深度,可选 minimal / medium / high,默认 medium。等级越高,构图与指令遵循越细致,耗时也越长。
json
{
"SubAppId": 123456789,
"ModelName": "GEM",
"ModelVersion": "3.6",
"FileInfos": [
{
"Type": "Url",
"Category": "Image",
"Url": "https://<host>/reference.png"
}
],
"Prompt": "Turn this sketch into a detailed 16:9 storyboard with 8 panels.",
"OutputConfig": {
"StorageMode": "Temporary"
},
"ExtInfo": "{\"AdditionalParameters\": \"{\\\"thinkingLevel\\\":\\\"high\\\"}\"}",
"SessionContext": "gem36-think-001"
}ModelName 写 GEM 或 GG 均可
接入指南中 Nano Banana 系列的 ModelName 记作 GEM/GG,两者等价;本页示例统一使用 GEM。