HERMES + Z IMAGE

在 Hermes Agent 中使用 Z Image。

Z Image 是阿里巴巴的快速图像生成模型,支持中英文双语文字渲染。Hermes Agent 通过 RunAPI custom provider 端点调用它——与聊天使用相同的 base_url 和 API key,无需额外插件或 GPU 租用。

一个 API key · 文生图端点 · 异步任务轮询
Use the RunAPI text_to_image endpoint to generate an image with Z Image.

Requirements:
- Use the RUNAPI_API_KEY environment variable for authentication.
- Send a POST request to https://runapi.ai/v1/text_to_image.
- Set model to "z-image".
- Write a descriptive prompt for the image you want to generate.
- The response returns a task_id. Poll the task status endpoint until the task completes, then retrieve the image URL from the output.
- Use the custom:runapi provider configured in your Hermes Agent config.yaml.
curl -X POST https://runapi.ai/v1/text_to_image \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-image",
    "prompt": "A neon-lit Tokyo street at night with Japanese shop signs, cinematic lighting, 8K detail"
  }'
{
  "task_id": "tsk_abc123",
  "status": "pending",
  "model": "z-image"
}
复制 curl 命令进行测试 z-image
工作原理

三步在 Hermes Agent 中使用 Z Image

1

配置 RunAPI

将 RunAPI API key 设置为环境变量。如果你已经在 Hermes Agent 中将 RunAPI 配置为 custom provider,同一个 key 和 base_url 也适用于图像生成。

export RUNAPI_API_KEY=runapi_xxx
2

调用 Z Image

向 text_to_image 端点发送 POST 请求,将 model 设为 z-image,并附上文字 prompt。Z Image 支持中英文双语 prompt,并能精准渲染文字。

text_to_image
3

获取结果

API 立即返回 task_id。轮询任务状态端点,直到状态变为 completed,然后从响应输出中获取生成的图像 URL。

task_id: tsk_abc123
参数

Z Image API 参数

参数 类型 说明
model string 必填。使用 z-image。
prompt string 文字描述,支持中文和英文。
negative_prompt string 可选。图像中需要避免的内容。
size string 可选。输出尺寸,例如 1024x1024。

Hermes Agent 上的 Z Image 是什么?

Z Image 亚秒级生成写实图像,提示词遵从度高,面部细节精准。基于 Apache 2.0 开源权重,通过 RunAPI 每张约 $0.004,是最快也是最便宜的图像模型。Hermes Agent 通过与聊天相同的 custom provider 调用它。

Z Image 使用场景

影视动画分镜制作

以亚秒级速度生成分镜帧,快速迭代构图和摄像机角度,速度足以跟上实时创意讨论的节奏。

电商产品可视化

以 RunAPI 上最低的单张成本生成具有写实材质和光线效果的产品列表图,适合大批量目录生成。

教育插图

创作带中英双语文字标注的教育示意图和插图,适用于面向中英文受众的教科书、课程材料和培训内容。

常见问题

Z Image + Hermes Agent 常见问题

Hermes Agent 通用配置

还没配置?从 Hermes Agent 的 RunAPI 配置指南开始。

Hermes Agent 配置指南 →

Z Image 模型目录

查看所有 Z Image 变体、价格和 API 文档。

Z Image 模型 →

立即在 Hermes Agent 中试用 Z Image。

获取免费 RunAPI key,配置 custom provider,开始生成支持双语文字渲染的图像。