HERMES + FLUX 2

在 Hermes Agent 中使用 Flux 2。

Black Forest Labs 的 Flux 2 提供兩種品質層級 — Pro 以每張 5 美分快速生成,Flex 以 14 美分產出更高保真度。兩者都支援文生圖和多來源 remix,可選 1k 或 2k 解析度。Hermes Agent 透過 custom:runapi provider 呼叫 — 使用與聊天相同的 key 和 base URL。

一個 API key · 文生圖 + remix 端點 · 1k / 2k 解析度
Use RunAPI to generate an image with Flux 2 Pro through Hermes Agent.

Requirements:
- Use the custom:runapi provider already configured in Hermes Agent
- Call the RunAPI text_to_image endpoint at https://runapi.ai/v1/text_to_image
- Set model to "flux-2-pro-text-to-image"
- The RUNAPI_API_KEY environment variable provides authorization
- Optionally set output_resolution to "1k" or "2k" and aspect_ratio to control dimensions
- The response is async — poll the task status endpoint until the task completes, then retrieve the image 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

設定 RunAPI

設定 RUNAPI_API_KEY 環境變數。如果您已在 Hermes Agent 中將 RunAPI 新增為 custom:runapi provider 用於聊天,同一個 key 和 base_url 也適用於 Flux 2 圖片生成 — 無需額外設定。

export RUNAPI_API_KEY=runapi_xxx
2

呼叫 Flux 2

向 text_to_image 端點發送 POST 請求,model 設為 flux-2-pro-text-to-image。加入 prompt,並可選擇性設定 aspect_ratio(1:1、4:3、16:9 等)和 output_resolution(1k 或 2k)。若要進行多來源 remix,改用 remix_image 端點搭配 source_image_urls。

text_to_image
3

取得結果

端點會回傳一個任務 ID。輪詢任務狀態端點,直到狀態變為 completed,然後從回應中取得生成的圖片 URL。RunAPI SDK 和 CLI 會自動處理輪詢。

task_id: tsk_abc123
參數

Flux 2 API 參數

參數 類型 說明
model string 必填。flux-2-pro-text-to-image、flux-2-flex-text-to-image、flux-2-pro-remix-image 或 flux-2-flex-remix-image。
prompt string 要生成的圖片文字描述。
aspect_ratio string 選填。輸出長寬比:1:1、4:3、3:4、16:9、9:16、3:2 或 2:3。Remix 端點還接受 auto。
output_resolution string 選填。1k(預設)或 2k。較高解析度的每張圖片費用較高。
source_image_urls array remix_image 必填。要混合或轉換的來源圖片 URL 陣列。
callback_url string 選填。用於非同步完成通知的 Webhook URL。

Hermes Agent 上的 Flux 2 是什麼?

Black Forest Labs 的 Flux 2 提供使用者評價「真的能以假亂真」的照片真實感,其材質保真度命中率使其成為取代圖庫照片的首選。Hermes Agent 透過 RunAPI custom provider 呼叫 Flux 2,讓你能大規模迭代——從相同的提示詞生成數十個品牌一致的變體,無需手動微調。

Flux 2 使用情境

取代圖庫攝影

透過按需生成逼真圖像——商品照、生活風格場景、建築視覺化——以圖庫照片費用的一小部分,取代付費圖庫訂閱。

遊戲開發者的角色設定圖

從多個角度生成一致的角色參考設定圖,Flux 2 的多參考調節讓角色設計在不同姿勢間保持穩定。

線上課程講師虛擬形象

為線上課程創建一致的講師虛擬形象,在數百個課程縮圖和投影片插圖中保持相同的面部特徵和風格。

FAQ

Flux 2 + Hermes Agent 常見問題

Hermes Agent 通用設定

尚未設定?請從 Hermes Agent 的 RunAPI 設定指南開始。

Hermes Agent 設定指南 →

Flux 2 模型目錄

查看所有 Flux 2 變體、定價與 API 文件。

Flux 2 模型 →

立即在 Hermes Agent 中試用 Flux 2。

取得免費的 RunAPI key,設定 custom:runapi provider,即可開始使用 Flux 2 Pro 或 Flex 生成圖片。