Google Nano Banana Lite 文生图 API

google/nano-banana-2-lite/text-to-image

Google Nano Banana 2 Lite 文生图可根据文本提示词生成高质量图片,具备低延迟、灵活宽高比和快速出图能力,适用于创意与生产工作流。即开即用的 REST 推理 API,性能出色,无冷启动,价格实惠。

示例

Google Nano Banana Lite 文生图 API example 1
Google Nano Banana Lite 文生图 API example 2
Google Nano Banana Lite 文生图 API example 3

参数

名称类型默认约束说明
prompt *提示词textarea≤ 5000 chars用于描述要生成图片的文本提示词。
aspect_ratio宽高比select1:11:1 | 3:2 | 2:3 | 3:4 | 4:3 | 4:5 | 5:4 | 9:16 | …输出图片的宽高比。

API

通过统一 REST API 调用本模型;在 API Keys 页获取密钥。

cURL
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/google/nano-banana-2-lite/text-to-image" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "prompt": "A cozy modern reading nook by a large rain-speckled window, soft morning light, overflowing bookshelf, green velvet armchair, knitted blanket, steaming cup of tea on a wooden side table, indoor plants, realistic interior photography, warm neutral tones, high detail",
    "aspect_ratio": "4:5"
  }
}'

# 2) Poll until status is "completed", then read the output URLs
curl "https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID" \
  -H "Authorization: Bearer YOUR_API_KEY"
Python
import time, requests

API_KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

# 1) Submit
resp = requests.post(
    "https://www.namifusion.com/api/v1/marketplace/run/google/nano-banana-2-lite/text-to-image",
    headers=HEADERS,
    json={
        "input": {
            "prompt": "A cozy modern reading nook by a large rain-speckled window, soft morning light, overflowing bookshelf, green velvet armchair, knitted blanket, steaming cup of tea on a wooden side table, indoor plants, realistic interior photography, warm neutral tones, high detail",
            "aspect_ratio": "4:5"
        }
    },
)
resp.raise_for_status()  # 401/402/429/5xx stop here instead of polling a bad task
task = resp.json()

# 2) Poll until a terminal state (completed / failed / cancelled).
#    This model is allowed up to 300s server-side.
deadline = time.time() + 360
while task.get("status") not in ("completed", "failed", "cancelled"):
    if time.time() > deadline:
        raise TimeoutError(f"still {task.get('status')} — keep the task_uuid and poll later")
    time.sleep(3)
    poll = requests.get(f"https://www.namifusion.com/api/v1/marketplace/run/tasks/{task['task_uuid']}", headers=HEADERS)
    poll.raise_for_status()
    task = poll.json()

print(task["status"], task.get("output"))
JavaScript
const API_KEY = "YOUR_API_KEY";
const HEADERS = { Authorization: `Bearer ${API_KEY}` };

// 1) Submit
const resp = await fetch("https://www.namifusion.com/api/v1/marketplace/run/google/nano-banana-2-lite/text-to-image", {
  method: "POST",
  headers: { ...HEADERS, "Content-Type": "application/json" },
  body: JSON.stringify({
    "input": {
      "prompt": "A cozy modern reading nook by a large rain-speckled window, soft morning light, overflowing bookshelf, green velvet armchair, knitted blanket, steaming cup of tea on a wooden side table, indoor plants, realistic interior photography, warm neutral tones, high detail",
      "aspect_ratio": "4:5"
    }
  }),
});
if (!resp.ok) throw new Error(`submit failed: ${resp.status} ${await resp.text()}`);
let task = await resp.json();

// 2) Poll until a terminal state (completed / failed / cancelled).
//    This model is allowed up to 300s server-side.
const deadline = Date.now() + 360 * 1000;
while (!["completed", "failed", "cancelled"].includes(task.status)) {
  if (Date.now() > deadline) throw new Error(`still ${task.status} — keep the task_uuid and poll later`);
  await new Promise((r) => setTimeout(r, 3000));
  const poll = await fetch(`https://www.namifusion.com/api/v1/marketplace/run/tasks/${task.task_uuid}`, { headers: HEADERS });
  if (!poll.ok) throw new Error(`poll failed: ${poll.status}`);
  task = await poll.json();
}

console.log(task.status, task.output);

文档

Google Nano Banana Lite Text to Image API

低延迟文本生成图片模型,兼顾速度、质量与成本效率。

Google Nano Banana 2 Lite Text to Image 是一款面向创意生产与内容工作流的轻量级文本生成图片模型。它支持灵活的宽高比选择、标准图片输出格式,并以低延迟、无冷启动和稳定的单图生成体验,帮助团队快速完成从创意探索到生产落地的视觉生成任务。

🚀 核心特性

  • 低延迟生成:针对快速出图场景优化,适合高频迭代与批量创意测试。
  • 无冷启动体验:减少等待时间,提升生产环境中的可预测性与响应效率。
  • 灵活宽高比:支持正方形、横屏、竖屏、宽屏与超宽屏等常见布局,便于适配不同发布渠道。
  • 高质量单图输出:每次请求生成 1 张图片,成本清晰、行为稳定,适合标准化工作流。
  • 多种输出格式:支持 PNG、JPEG、WEBP,便于兼顾画质、文件体积与网页分发需求。
  • 轻量易用:公开能力聚焦于提示词、宽高比与输出格式,降低使用门槛并简化创作流程。

🛠️ 技术规格

项目说明
模型名称Google Nano Banana 2 Lite Text to Image
模型 IDgoogle/nano-banana-2-lite/text-to-image
模型类型文本生成图片模型
模型架构轻量级文本生成图片架构(Lite)
输入提示词
输出单张图片
生成数量1
支持的宽高比1:13:22:33:44:34:55:49:1616:921:9
默认宽高比1:1
输出格式pngjpegwebp
默认输出格式png
延迟特性低延迟、无冷启动
典型工作流创意出图、营销素材、提示词测试、版式定向生成

示例提示词

  1. A cinematic portrait of a young woman standing in neon rain, dramatic lighting, shallow depth of field, ultra detailed
  2. A minimalist product advertisement for a luxury skincare bottle on a marble surface, soft studio lighting, clean composition
  3. A fantasy floating city above the clouds at sunrise, epic scale, concept art, highly detailed atmosphere

💰 价格

计费项价格
每生成 1 张图片$0.035

💡 最佳使用场景

  • 创意概念设计:用于概念图、插画草案、缩略图和视觉方向探索。
  • 营销与品牌内容:快速生成广告图、社交媒体配图、博客头图与活动宣传素材。
  • 提示词迭代测试:适合对提示词措辞、构图方向、光影风格进行快速试验。
  • 多版式内容生产:根据不同投放渠道生成正方形、竖屏、横屏或横幅风格图片。

🔗 相关模型

  • Google Nano Banana 2 Lite Edit:适合在已有图片基础上进行轻量编辑与调整。
  • Google Nano Banana 2 Text To Image:适合对生成质量或能力范围有更高要求的文本生成图片场景。

相关模型

xAI Grok Imagine Image v2.0 文生图
Text to ImageX Ai

xAI Grok Imagine Image v2.0 文生图

xAI Grok Imagine Image V2.0 文生图可根据文本提示词生成高质量图片,并支持配置宽高比、分辨率和质量,适用于创意视觉、社交内容、营销素材和生产工作流。提供开箱即用的 REST 推理 API,性能出色,无冷启动,价格实惠。

$0.080 / 每次
Qwen Image 3.0 Pro 文生图
Text to ImageQwen Image 3.0 Pro

Qwen Image 3.0 Pro 文生图

Qwen Image 3.0 Pro 是一款专业级文生图模型,具备卓越画质和先进的提示词理解能力。最高支持 2k。提供开箱即用的 REST inference API,性能出色,无冷启动,价格实惠。

$0.080 / 每次
OpenAI GPT Image 2 文本生成图片
Text to ImageOpenAI

OpenAI GPT Image 2 文本生成图片

OpenAI 的 GPT Image 2 文本生成图片模型可根据自然语言提示词生成高质量图片。提供即用型 REST 推理 API,性能最佳,无冷启动,价格实惠。

$0.660 / 每次
OpenAI GPT Image 2 Edit 图像编辑
Text to ImageOpenAI

OpenAI GPT Image 2 Edit 图像编辑

OpenAI 的 GPT Image 2 Edit 可通过自然语言指令结合一张或多张参考图片进行图像编辑。提供即用型 REST 推理 API,性能最佳,无冷启动,价格实惠。

$0.660 / 每次
Nami Z-Image T2I Spicy
Text to Image

Nami Z-Image T2I Spicy

根据文本提示词生成图片,支持自定义宽高、提示词优化和随机种子。

$0.020 / 每次
Nano Banana 文生图
Text to ImageGoogle

Nano Banana 文生图

Gemini 2.5 Flash 标准版。轻量极速。兼顾速度与成本,是批量生成与快速原型设计的最佳选择。

$0.040 / 每次
Nano Banana Pro 文生图
Text to ImageGoogle

Nano Banana Pro 文生图

Gemini 3.0 Pro 旗舰版。专为 4K 原生画质打造,支持图像内多语言文字渲染与专业摄影参数控制。

$0.140 / 每次
Nano Banana Pro 文生图
Text to ImageGoogle

Nano Banana Pro 文生图

Gemini 3.0 Pro 旗舰版。专为 4K 原生画质打造,支持图像内多语言文字渲染与专业摄影参数控制。

$0.070 / 每次