在 Hermes Agent 中使用 Seedream。
Seedream 是字节跳动的图像生成模型,具有强大的文字排版渲染能力和高达 4K 的输出。Hermes Agent 通过与聊天相同的 RunAPI custom provider 和 API key 调用它,无需额外插件或 GPU 租用。
Generate a 4K product hero image using Seedream through RunAPI.
Requirements:
- Use the RunAPI text_to_image endpoint via the custom:runapi provider.
- Set model to seedream-4.5-text-to-image.
- Read the API key from RUNAPI_API_KEY. Do not hardcode the key.
- Poll the task status endpoint until the task completes.
- Return the generated image URL from the task response.
curl -X POST https://runapi.ai/api/v1/task/text_to_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-4.5-text-to-image",
"prompt": "A premium coffee bag on a marble countertop, warm morning light, bold serif text FRESH ROAST, 4K product photography"
}'
{
"task_id": "tsk_abc123",
"status": "pending",
"model": "seedream-4.5-text-to-image"
}
三步在 Hermes Agent 中使用 Seedream
配置 RunAPI
如果你已经在 Hermes Agent 中为聊天配置了 RunAPI,则无需额外操作。同一个 custom:runapi provider 和 RUNAPI_API_KEY 也可以处理图像生成。否则,请使用 base_url https://runapi.ai/v1 添加 custom provider,并运行 hermes doctor。
export RUNAPI_API_KEY=runapi_xxx
调用 Seedream
向 text_to_image 端点发送请求,将 model 设为 seedream-4.5-text-to-image,并附上描述图像的文字 prompt。RunAPI 立即返回任务 ID。
text_to_image
获取结果
使用返回的任务 ID 轮询任务状态端点。当状态变为 completed 时,响应中包含生成的图像 URL。RunAPI SDK 会自动处理轮询。
task_id: tsk_abc123
Seedream API 参数
| 参数 | 类型 | 说明 |
|---|---|---|
model |
string |
必填。seedream-4.5-text-to-image、seedream-4.5-edit、seedream-5-lite-text-to-image。 |
prompt |
string |
对所需图像的文字描述。 |
size |
string |
可选。输出尺寸,最高支持 4K。 |
image_url |
string |
编辑模式的源图像。 |
Hermes Agent 上的 Seedream 是什么?
字节跳动的 Seedream 是 LM Arena 排行榜榜首图像模型,以专业级输出著称。它理解复杂提示词结构,对写实和风格化内容均能开箱即用,在批量生成中保持一致视觉风格方面尤为出色。Hermes Agent 通过 RunAPI custom provider 调用它。
Seedream 使用场景
社交媒体营销活动
跨整个活动生成一致的品牌代言人图像,模型在数十个输出中保持相同的角色外观和品牌识别度。
书籍封面与产品包装设计
以 4K 分辨率创作书籍封面、产品包装和标签设计,文字渲染精准,排版控制精确。
品牌视觉识别开发
探索品牌识别的多个视觉方向——标志、配色方案、产品效果图——Seedream 出色的提示词遵从性确保每个变体都忠实于设计简报。
Seedream + Hermes Agent 常见问题
可以。在 Hermes Agent 中将 RunAPI 配置为 custom provider,设置 base_url 为 https://runapi.ai/v1,然后以 seedream-4.5-text-to-image 为 model 调用 text_to_image 端点。同一个 API key 可以同时处理聊天和图像生成。
不需要。为 custom:runapi provider 配置的同一个 RUNAPI_API_KEY 也可以调用 Seedream 和 RunAPI 目录中的所有其他图像模型。一个 key,一个计费账户。
异步。RunAPI 在首次调用时返回任务 ID。轮询任务状态端点,直到状态为 completed,然后从响应中获取图像 URL。SDK 和 CLI 会自动处理轮询。
Seedream 按次计费。查看 RunAPI 定价页面获取最新价格。生成失败不收费。