Nano Banana 2 已在 AI Gateway 上线

发布: (2026年2月26日 GMT+8 21:00)
3 分钟阅读

Source: Vercel Blog

概览

Gemini 3.1 Flash Image Preview(Nano Banana 2)现已在 AI Gateway 上线。此版本在保持闪速模型生成速度和成本的同时提升了视觉质量。

Nano Banana 2 可以使用 Google 图片搜索将输出与真实世界图像关联,通过检索实时视觉数据帮助渲染不太知名的地标和物体。模型还引入了可配置的思考层级(Minimal 与 High),使其在渲染前能够对复杂提示进行推理。新增的分辨率和宽高比(512 p、1:4、1:8)与已有选项一起,扩展了对更广泛创意资产的支持。

新功能

  • Google 图片搜索关联 – 拉取实时视觉数据以生成更精准的图像。
  • 可配置的思考层级minimal 用于快速响应,high 用于更深入的推理。
  • 额外的分辨率与宽高比 – 512 p、1:4、1:8。
  • 多模态输出 – 在一次调用中同时生成文本和图像。

使用方法

基础示例

import { streamText } from 'ai';

const result = streamText({
  model: 'google/gemini-3.1-flash-image-preview',
  providerOptions: {
    google: { responseModalities: ['TEXT', 'IMAGE'] },
  },
  prompt: 'Generate an image of the 2026 Super Bowl at golden hour',
});

配置思考层级

import { streamText } from 'ai';

const result = streamText({
  model: 'google/gemini-3.1-flash-image-preview',
  providerOptions: {
    google: {
      responseModalities: ['TEXT', 'IMAGE'],
      thinkingConfig: {
        includeThoughts: true,
        thinkingLevel: 'high',
      },
    },
  },
  prompt: `An exploded view diagram of a modern GPU, showing the die, HBM stacks, interposer,
    and cooling solution as separate floating layers with labeled callouts.`,
});

AI Gateway

AI Gateway 提供统一的 API,用于调用模型、跟踪使用情况和费用,并配置重试、故障转移以及性能优化,以实现高于单一提供商的可用性。它内置了可观测性自带密钥支持,以及具备自动重试的智能提供商路由。

了解更多关于AI Gateway的信息,查看AI Gateway 模型排行榜,或在我们的模型试玩平台中尝试。

0 浏览
Back to Blog

相关文章

阅读更多 »

Vercel Queues 现已公开测试

概述 Vercel Queues 是一个持久化事件流系统,使用 … 构建,现在已向所有团队开放公开测试版。它提供以下功能:- 直接消息发布…