HERMES + NANO BANANA

在 Hermes Agent 中使用 Nano Banana。

Nano Banana 是 Google 基于 Gemini 的图像生成模型,在生成图像的文本渲染方面处于行业领先。Pro 输出最高 4K 分辨率,Nano Banana 2 针对速度优化并支持更多宽高比,Edit 则用于修改现有图像。Hermes Agent 通过 RunAPI 自定义 provider 调用全部三个 — 无需 ComfyUI 或 GPU 配置。

一个 API 密钥 · 文生图 + 编辑端点 · 最高 4K 输出
使用 RunAPI 通过 Hermes Agent 用 Google Nano Banana Pro 生成图像。

要求:
- 从 RUNAPI_API_KEY 读取 API 密钥。不要硬编码密钥。
- 使用 Hermes Agent 中已配置的 custom:runapi provider。
- 向 https://runapi.ai/api/v1/nano_banana/text_to_image 发送 POST 请求。
- 将 model 设为 "nano-banana-pro"。
- 编写描述性的提示词。Nano Banana 擅长在图像中渲染文本,因此请将任何文字叠加内容写入提示词。
- 可选:将 output_resolution 设为 "4k" 以获得最高质量。
- 响应返回一个 task_id。轮询任务状态端点直到任务完成。
- 任务完成后,从响应中获取图像 URL。
curl -X POST https://runapi.ai/api/v1/nano_banana/text_to_image \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-pro",
    "prompt": "A minimalist product card for a coffee brand, the text DARK ROAST in bold sans-serif across the top, a steaming cup below, warm studio lighting",
    "aspect_ratio": "4:3",
    "output_resolution": "4k",
    "output_format": "png"
  }'
{
  "task_id": "tsk_abc123",
  "status": "pending",
  "model": "nano-banana-pro"
}
复制 curl 命令进行测试 nano-banana
工作原理

三步在 Hermes Agent 中使用 Nano Banana

1

Configure RunAPI

Set the RUNAPI_API_KEY environment variable. If you already configured RunAPI as a custom:runapi provider in Hermes Agent for chat, the same key and base_url work for Nano Banana image generation.

export RUNAPI_API_KEY=runapi_xxx
2

Call Nano Banana

Send a POST to the text_to_image endpoint with model set to nano-banana-pro for highest quality, nano-banana-2 for speed, or nano-banana for the base variant. Set output_resolution to 4k on Pro or 2 for maximum detail. For editing, POST to edit_image with nano-banana-edit and include an image_url.

POST /api/v1/nano_banana/text_to_image
3

Get the result

The response includes a task_id. Poll the task status endpoint until status changes to completed. The finished response contains the generated image URL. RunAPI SDKs and the CLI handle polling automatically.

task_id: tsk_abc123
参数

Nano Banana API 参数

参数 类型 说明
model string Required. nano-banana-pro (highest quality, 4K), nano-banana-2 (fast, extended ratios), nano-banana (base), or nano-banana-edit (editing).
prompt string Text description of the desired image. Include any text you want rendered in the image — Nano Banana handles typography natively.
image_url string Source image URL. Required for nano-banana-edit, ignored for text_to_image variants.
aspect_ratio string Optional. Output aspect ratio. Pro accepts: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, auto. Nano Banana 2 adds 1:4, 1:8, 4:1, 8:1.
output_resolution string Optional. Pro and 2 only. Accepted values: 1k, 2k, 4k. Defaults to 1k.
output_format string Optional. Output file format. Accepted values: png, jpeg, jpg.
callback_url string Optional. Webhook URL that receives a POST when the task completes.

Hermes Agent 上的 Nano Banana 是什么?

Nano Banana 是 Google 图像模型,以有机设计特性和世界知识整合著称。它生成理解真实世界背景的图像——指定具体地标、产品类型或设计风格,它会从内置知识中调用,而非凭空猜测。Hermes Agent 通过 RunAPI custom provider 调用全部三个变体。

Nano Banana 使用场景

大批量设计资产生成

通过 Hermes Agent 批量生成多个视觉方向的设计资产——封面图、缩略图、广告素材——Nano Banana 的强提示词遵从性确保每个变体与简报保持一致。

包含品牌元素的广告创意

生成包含特定视觉元素、颜色方案和排版要求的广告创意,Nano Banana 的设计知识帮助在不需要手动微调的情况下产出可用的广告素材。

用于界面原型的 UI 截图

生成用于演示、原型或营销的真实感 UI 截图和应用界面效果图,充分利用 Nano Banana 对界面设计规范的理解。

常见问题

Nano Banana + Hermes Agent 常见问题

Crosslink Agent Title

Crosslink Agent Body

Crosslink Agent Label

Crosslink Model Title

Crosslink Model Body

Crosslink Model Label

Final Cta Title

Final Cta Body