gemini-nano-banana-2.1 为 Gemini 系列图像生成/编辑模型,支持文生图与多图参考编辑(换脸、换装、风格迁移等)。generateContentcandidates[0].content.parts[] 中的 inlineData(base64);传 response_format: "url" 时返回图片 URL(仅非流式)imageConfig.imageSize 仅支持 1K / 2K / 4K,默认 1K,不支持 512imageConfig.aspectRatio 支持 1:1, 16:9, 9:16, 4:3, 3:4, 2:3, 3:2, 4:5, 5:4, 1:4, 4:1, 1:8, 8:1, 21:9thinkingConfig.thinkingLevel 仅支持 minimal / high,不支持 thinkingBudget;也可用模型名后缀 -thinking / -nothinkinggemini-nano-banana-2.1 为 Gemini 系列图像生成/编辑模型,支持文生图与多图参考编辑(换脸、换装、风格迁移等)。generateContentcandidates[0].content.parts[] 中的 inlineData(base64);传 response_format: "url" 时返回图片 URL(仅非流式)imageConfig.imageSize 仅支持 1K / 2K / 4K,默认 1K,不支持 512imageConfig.aspectRatio 支持 1:1, 16:9, 9:16, 4:3, 3:4, 2:3, 3:2, 4:5, 5:4, 1:4, 4:1, 1:8, 8:1, 21:9thinkingConfig.thinkingLevel 仅支持 minimal / high,不支持 thinkingBudget;也可用模型名后缀 -thinking / -nothinking{
"contentType": "application/json",
"properties": {
"contents": {
"description": "对话内容。文生图只放一条 text;图片编辑/多图参考时在同一个 parts 内放 1 条 text + 多条 inline_data。",
"type": "array",
"x-i18n": {
"en-US": {
"description": "Conversation content. For text-to-image, only one text should be placed; for image editing/multi-image reference, place one text + multiple inline_data within the same parts."
}
}
},
"generationConfig": {
"description": "生成配置。注意:aspectRatio / imageSize 必须放在 imageConfig 内,放在 generationConfig 顶层会被忽略;不支持 negativePrompt、resolution 字段。",
"type": "object",
"x-i18n": {
"en-US": {
"description": "Generation configuration. Note: aspectRatio / imageSize must be placed within imageConfig; placing them at the top level of generationConfig will be ignored; negativePrompt and resolution fields are not supported."
}
}
},
"response_format": {
"description": "图片返回形式(平台扩展字段,非 Gemini 官方参数)。base64:图片在 parts[].inlineData.data 中返回(默认);url:图片以 parts[].fileData.fileUri 返回临时链接,仅非流式请求支持,流式传 url 会报 400。",
"enum": [
"base64",
"url"
],
"type": "string",
"x-i18n": {
"en-US": {
"description": "Image return format (platform extension field, not an official Gemini parameter). base64: image is returned in parts[].inlineData.data (default); url: image returns a temporary link in parts[].fileData.fileUri, only supported for non-streaming requests, passing url in streaming will result in a 400 error."
}
}
}
},
"required": [
"contents"
]
}[
"谷歌Gemini/原生格式"
]