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



参数
| 名称 | 类型 | 默认 | 约束 | 说明 |
|---|---|---|---|---|
| prompt *提示词 | textarea | — | ≤ 5000 chars | 用于描述要生成图片的文本提示词。 |
| aspect_ratio宽高比 | select | 1:1 | 1:1 | 3:2 | 2:3 | 3:4 | 4:3 | 4:5 | 5:4 | 9:16 | … | 输出图片的宽高比。 |
输出字段
| 字段 | 类型 | 说明 |
|---|---|---|
| images | array<string> |
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 |
| 模型 ID | google/nano-banana-2-lite/text-to-image |
| 模型类型 | 文本生成图片模型 |
| 模型架构 | 轻量级文本生成图片架构(Lite) |
| 输入 | 提示词 |
| 输出 | 单张图片 |
| 生成数量 | 1 |
| 支持的宽高比 | 1:1、3:2、2:3、3:4、4:3、4:5、5:4、9:16、16:9、21:9 |
| 默认宽高比 | 1:1 |
| 输出格式 | png、jpeg、webp |
| 默认输出格式 | png |
| 延迟特性 | 低延迟、无冷启动 |
| 典型工作流 | 创意出图、营销素材、提示词测试、版式定向生成 |
示例提示词
A cinematic portrait of a young woman standing in neon rain, dramatic lighting, shallow depth of field, ultra detailedA minimalist product advertisement for a luxury skincare bottle on a marble surface, soft studio lighting, clean compositionA 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:适合对生成质量或能力范围有更高要求的文本生成图片场景。
相关模型
z-image-spicy/text-to-image
从文本提示生成高质量图片,支持 256 至 1536 像素自定义尺寸、智能提示词扩写和随机种子,适合创意设计与批量出图。
xAI Grok Imagine Image v2.0 文生图
xAI Grok Imagine Image V2.0 文生图可根据文本提示词生成高质量图片,并支持配置宽高比、分辨率和质量,适用于创意视觉、社交内容、营销素材和生产工作流。提供开箱即用的 REST 推理 API,性能出色,无冷启动,价格实惠。
Qwen Image 3.0 Pro 文生图
Qwen Image 3.0 Pro 是一款专业级文生图模型,具备卓越画质和先进的提示词理解能力。最高支持 2k。提供开箱即用的 REST inference API,性能出色,无冷启动,价格实惠。
ai/prefect-pony-xl 动漫风格图片生成模型
Prefect Pony XL 可高质量生成动漫风格图片,适用于角色立绘和插画创作。提供开箱即用的 REST 推理 API,性能出色,无冷启动,价格实惠。
OpenAI GPT Image 2 文本生成图片
OpenAI 的 GPT Image 2 文本生成图片模型可根据自然语言提示词生成高质量图片。提供即用型 REST 推理 API,性能最佳,无冷启动,价格实惠。
OpenAI GPT Image 2 Edit 图像编辑
OpenAI 的 GPT Image 2 Edit 可通过自然语言指令结合一张或多张参考图片进行图像编辑。提供即用型 REST 推理 API,性能最佳,无冷启动,价格实惠。
OpenAI GPT Image 2.5 Sunburst 文本生成图片
面向复杂构图和高要求生产场景的高保真图片生成,最高支持 4K 输出。
OpenAI GPT Image 2.5 Flare 文本生成图片
根据自然语言提示词快速生成高质量图片,兼顾速度与效果,最高支持 4K 输出。