HERMES + FLUX 2

在 Hermes Agent 中使用 Flux 2。

Black Forest Labs 的 Flux 2 提供两个质量层级——Pro 以每张 5 美分实现快速生成,Flex 以 14 美分提供更高保真度。两者都支持文生图和多源 remix,分辨率可选 1k 或 2k。Hermes Agent 通过 custom:runapi 提供商调用它——使用与聊天相同的密钥和 base URL。

一个 API 密钥 · 文生图 + remix 端点 · 1k / 2k 分辨率
使用 RunAPI 通过 Hermes Agent 用 Flux 2 Pro 生成图像。

要求:
- 使用 Hermes Agent 中已配置的 custom:runapi 提供商
- 调用位于 https://runapi.ai/v1/text_to_image 的 RunAPI text_to_image 端点
- 将 model 设置为 "flux-2-pro-text-to-image"
- RUNAPI_API_KEY 环境变量提供授权
- 可选地将 output_resolution 设为 "1k" 或 "2k",并通过 aspect_ratio 控制尺寸
- 响应是异步的——轮询任务状态端点直到任务完成,然后获取图像 URL
curl -X POST https://runapi.ai/v1/text_to_image \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-2-pro-text-to-image",
    "prompt": "a ceramic vase with dried flowers on a linen tablecloth, natural window light, 35mm film grain",
    "aspect_ratio": "3:4",
    "output_resolution": "2k"
  }'
{
  "task_id": "tsk_abc123",
  "status": "pending",
  "model": "flux-2-pro-text-to-image"
}
复制 curl 命令进行测试 flux-2
工作原理

三步在 Hermes Agent 中使用 Flux 2

1

Configure RunAPI

Set the RUNAPI_API_KEY environment variable. If you already added RunAPI as a custom:runapi provider in Hermes Agent for chat, the same key and base_url work for Flux 2 image generation — no extra configuration needed.

export RUNAPI_API_KEY=runapi_xxx
2

Call Flux 2

Send a POST request to the text_to_image endpoint with model set to flux-2-pro-text-to-image. Include a prompt, and optionally set aspect_ratio (1:1, 4:3, 16:9, etc.) and output_resolution (1k or 2k). For multi-source remixing, use the remix_image endpoint with source_image_urls instead.

text_to_image
3

Get the result

The endpoint returns a task ID. Poll the task status endpoint until the status changes to completed, then retrieve the generated image URL from the response. RunAPI SDKs and the CLI handle polling automatically.

task_id: tsk_abc123
参数

Flux 2 API 参数

参数 类型 说明
model string Required. flux-2-pro-text-to-image, flux-2-flex-text-to-image, flux-2-pro-remix-image, or flux-2-flex-remix-image.
prompt string Text description of the image to generate.
aspect_ratio string Optional. Output aspect ratio: 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, or 2:3. Remix endpoints also accept auto.
output_resolution string Optional. 1k (default) or 2k. Higher resolution costs more per image.
source_image_urls array Required for remix_image. Array of source image URLs to blend or transform.
callback_url string Optional. Webhook URL for async completion notification.

Hermes Agent 上的 Flux 2 是什么?

Black Forest Labs 的 Flux 2 提供材质保真度高的写实图像生成。Hermes Agent 通过 RunAPI custom provider 调用 Flux 2,实现规模化迭代——从同一提示词生成数十个品牌一致的变体,无需手工微调。

Flux 2 使用场景

规模化品牌一致性图像

从同一提示词生成数十个品牌一致的图像变体,Hermes Agent 并行调度 Flux 2 任务并收集所有结果,无需手工处理每个输出。

生活方式与编辑摄影替代

以精准的光线、景深和材质效果生成生活方式摄影和编辑摄影内容,替代图库照片授权,用于营销活动。

游戏与创意项目概念图

为游戏开发、电影或创意项目生成写实环境、角色设计和道具概念图,400 万像素的输出提供足够细节用于进一步制作。

常见问题

Flux 2 + Hermes Agent 常见问题

Hermes Agent 通用配置

尚未配置?请从 Hermes Agent 的 RunAPI 配置指南开始。

Hermes Agent 配置指南 →

Flux 2 模型目录

查看所有 Flux 2 版本、定价和 API 文档。

Flux 2 模型 →

立即在 Hermes Agent 中试用 Flux 2。

免费获取 RunAPI 密钥,配置 custom:runapi 提供商,开始使用 Flux 2 Pro 或 Flex 生成图像。