Felo API PlatformFelo API Platform
返回模型列表

Nano Banana Pro (Gemini 3 Pro Image) API

Nano Banana Pro(Gemini 3 Pro Image)是 Google 的旗舰图像生成与编辑模型,擅长高精度文字渲染与专业可控出图。

Nano Banana Pro 是 Gemini 3 Pro Image 的正式名称,基于具备推理能力的 Gemini 3 Pro 基础模型构建,定位为 Google 的旗舰图像生成与编辑模型。它支持文本与图像输入、图像输出,上下文为 65,536 个输入 token,输出上限为 32,768 个 token,可在 0.5K、1K、2K、4K 四个分辨率档位出图,最高达 5632 x 3072 像素,并支持 10 种图像宽高比。

它最突出的能力是图中的文字渲染:可输出多语言的可读文字,从短标语到长段落均可,并理解排版、字体与书法设计元素,支持多语言文本生成与本地化翻译。同时,它能在单次输出中组合最多 14 张参考图,并在画面中为最多 5 个人物保持外貌一致性;还可对机位角度、光照、风格、色调与焦点进行创作控制,并支持多轮对话式图像编辑。借助与 Google 搜索的 grounding 集成,它能把天气、体育赛果等实时信息可视化;每张生成图都会嵌入不可见的 SynthID 数字水印。

它适合营销与广告物料的规模化生成、信息图与图表、演示视觉、产品原型与概念设计、教育材料、手写笔记转结构化图表、自拍转职业头像、草图转逼真 3D 结构、产品摄影与复杂场景构图,以及海报、广告、信息图等文字密集的视觉内容。需要注意,它的生成速度慢于 Nano Banana 2:每张约 30.8 秒,而后者约 15.5 秒。

更新时间:

模型 ID

gemini-3-pro-image
上下文
131.072K
最大输出
32.768K
输入
image / text
输出
image / text

核心要点

  • 最高 4K、5632 x 3072 像素出图
  • 多语言文字渲染,支持长段落
  • 最多组合 14 张参考图
  • 最多保持 5 个人物外貌一致
  • 可控制机位、光照、风格与色调
  • 接入 Google 搜索实时信息

供应商

最优价格
3 个供应商

比较不同供应商的调用价格,点击供应商可查看完整费用和适用条件。

供应商 · 计费明细
可用率
$2$12$0.2$0.2
$2$1.2$12$7.2未公布未公布
$2$12$0.2$0.2

推理能力

始终启用
是

快速开始

提交图片任务、轮询状态,再保存图片。以下示例使用 curl 和 Python 3(仅标准库,无需安装依赖)。

POST https://openapi.felo.ai/api/v1/images/generations

1填入 API key

从 Felo API Platform 账户创建 key,并设置为环境变量。

export FELO_API_KEY="YOUR_API_KEY"

2发起第一次请求

可选参数的取值因模型而异,示例不预设这些值;添加前请在 Playground 确认。请求字段与 model、prompt 同级,不包在 input 中。

curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H "Content-Type: application/json" \
  -o created.json \
  -d '{
  "prompt": "A studio product photo of a ceramic coffee cup on warm linen, soft morning light",
  "model": "gemini-3-pro-image"
}'

3轮询任务

提交后获得 task_id;queued、running 时每 3 秒查询一次,succeeded、failed 或 interrupted 时停止。示例最多等待 30 分钟。保留 created.json 可继续查询同一任务,避免重复提交。

python3 - <<'PY'
import json, os, time
from pathlib import Path
from urllib.parse import quote
from urllib.request import Request, urlopen

task = json.loads(Path("created.json").read_text())
task_id = task["task_id"]
url = "https://openapi.felo.ai/api/v1/images/generations/" + quote(task_id, safe="")
headers = {"Authorization": "Bearer " + os.environ["FELO_API_KEY"]}
deadline = time.monotonic() + 1800

while task["status"] in ("queued", "running"):
    if time.monotonic() >= deadline:
        raise TimeoutError(f"Keep task_id={task_id} to resume polling")
    time.sleep(3)
    with urlopen(Request(url, headers=headers), timeout=60) as response:
        task = json.load(response)
    if task.get("task_id") != task_id or task.get("kind") != "image":
        raise ValueError("Unexpected task response")
    print(task["status"])

if task["status"] != "succeeded":
    raise RuntimeError(task.get("error") or task["status"])
if not task.get("outputs"):
    raise ValueError("Task succeeded without image outputs")
Path("task.json").write_text(json.dumps(task))
print("Saved task.json")
PY

4下载输出

成功后从 task.json 读取 outputs 并保存。结果兼容 HTTPS 地址、URL 对象和 b64_json。签名地址请及时下载;下载图片时无需携带 API Key。

python3 - <<'PY'
import base64, json
from pathlib import Path
from urllib.request import urlopen

task = json.loads(Path("task.json").read_text())
if task.get("status") != "succeeded" or not task.get("outputs"):
    raise ValueError("No completed image outputs")
extensions = {"image/png": ".png", "image/jpeg": ".jpg", "image/webp": ".webp", "image/gif": ".gif", "image/avif": ".avif"}

for index, output in enumerate(task["outputs"], 1):
    item = output if isinstance(output, dict) else {}
    url = output if isinstance(output, str) else item.get("url") or item.get("unsigned_url")
    mime = item.get("media_type") or "image/png"
    if url and url.startswith("https://"):
        with urlopen(url, timeout=60) as response:
            data = response.read()
            mime = response.headers.get_content_type()
    elif url and url.startswith("data:image/") and ";base64," in url:
        header, encoded = url.split(",", 1)
        mime = header[5:].split(";", 1)[0]
        data = base64.b64decode(encoded, validate=True)
    elif item.get("b64_json"):
        data = base64.b64decode(item["b64_json"], validate=True)
    else:
        raise ValueError("Unrecognized image output")
    path = Path(f"image-{index}" + extensions.get(mime, ".bin"))
    path.write_bytes(data)
    print(path)
PY
input_references

编辑图片时,将示例地址替换为你的 HTTPS 图片地址或 base64 图片 data URL。提交一次后,沿用相同的轮询与保存步骤。

curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H "Content-Type: application/json" \
  -o created.json \
  -d '{
  "prompt": "Keep the product and framing. Replace the background with a sunlit marble countertop.",
  "model": "gemini-3-pro-image",
  "input_references": [
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/product.png"
      }
    }
  ]
}'

支持的参数

  • n
  • seed
  • stop
  • tools
  • top_p
  • reasoning
  • max_tokens
  • resolution
  • temperature
  • tool_choice
  • aspect_ratio
  • response_format
  • input_references
  • include_reasoning
  • structured_outputs

想查看完整文档?

API 文档 →

常见问题

什么是 Nano Banana Pro (Gemini 3 Pro Image)?

Nano Banana Pro 是 Gemini 3 Pro Image 的正式名称,基于具备推理能力的 Gemini 3 Pro 基础模型构建,定位为 Google 的旗舰图像生成与编辑模型。它支持文本与图像输入、图像输出,上下文为 65,536 个输入 token,输出上限为 32,768 个 token,可在 0.5K、1K、2K、4K 四个分辨率档位出图,最高达 5632 x 3072 像素,并支持 10 种图像宽高比。 它最突出的能力是图中的文字渲染:可输出多语言的可读文字,从短标语到长段落均可,并理解排版、字体与书法设计元素,支持多语言文本生成与本地化翻译。同时,它能在单次输出中组合最多 14 张参考图,并在画面中为最多 5 个人物保持外貌一致性;还可对机位角度、光照、风格、色调与焦点进行创作控制,并支持多轮对话式图像编辑。借助与 Google 搜索的 grounding 集成,它能把天气、体育赛果等实时信息可视化;每张生成图都会嵌入不可见的 SynthID 数字水印。 它适合营销与广告物料的规模化生成、信息图与图表、演示视觉、产品原型与概念设计、教育材料、手写笔记转结构化图表、自拍转职业头像、草图转逼真 3D 结构、产品摄影与复杂场景构图,以及海报、广告、信息图等文字密集的视觉内容。需要注意,它的生成速度慢于 Nano Banana 2:每张约 30.8 秒,而后者约 15.5 秒。

如何计算调用费用?

费用取决于你使用的供应商、对应价格和实际用量。长文本输入等情况可能适用不同价格,详见计费明细。

Nano Banana Pro 支持哪些输入和输出?

支持文本输入与图像输入,输出为图像。单次输出中最多可组合 14 张参考图。

它的上下文和输出长度是多少?

上下文为 65,536 个输入 token,输出上限为 32,768 个 token。

出图分辨率和宽高比有哪些选择?

提供 0.5K、1K、2K、4K 四个分辨率档位,最高 5632 x 3072 像素,并支持 10 种图像宽高比。

它适合哪些任务?

适合营销与广告素材、信息图与图表、演示视觉、产品摄影与复杂场景构图,以及海报、广告等文字密集的视觉内容。

与 Nano Banana 2 相比有什么区别?

Nano Banana Pro 在分辨率和专业控制上更强,Nano Banana 2 则在日常编辑上更快:约 15.5 秒每张,而 Pro 约 30.8 秒每张。

生成的图片有水印吗?

每张生成的图像都会加入不可见的 SynthID 数字水印。

相关模型