HERMES + GROK IMAGINE

在 Hermes Agent 中使用 Grok Imagine。

Grok Imagine 是 xAI 的圖像和影片生成套件——文生圖、圖生圖、文生影片和圖生影片。Hermes Agent 透過與聊天相同的 RunAPI custom provider 和 API key 呼叫它,無需安裝額外外掛。

一個 API key · 文生圖端點 · 非同步任務輪詢
Use RunAPI to generate an image with xAI Grok Imagine.

Requirements:
- Use the RunAPI API at https://runapi.ai/v1/text_to_image.
- Read the API key from RUNAPI_API_KEY environment variable.
- Use the custom:runapi provider already configured in Hermes Agent.
- Set the model to "grok-imagine-text-to-image".
- Write a descriptive prompt for the image you want.
- The response returns a task_id. Poll the task status endpoint until the task completes, then retrieve the output URL.
curl -X POST https://runapi.ai/v1/text_to_image \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-text-to-image",
    "prompt": "a robot hand placing a chess piece on a board, dramatic side lighting, slow motion feel"
  }'
{
  "task_id": "tsk_abc123",
  "status": "pending",
  "model": "grok-imagine-text-to-image"
}
複製 curl 指令進行測試 grok-imagine
運作原理

三步在 Hermes Agent 中使用 Grok Imagine

1

設定 RunAPI

在 shell profile 中設定 RUNAPI_API_KEY 環境變數。若 Hermes Agent 中已設定 custom:runapi provider 用於聊天,同一個 key 也適用於 Grok Imagine,無需額外設定。

export RUNAPI_API_KEY=runapi_xxx
2

呼叫 Grok Imagine

向 text_to_image 端點發送 POST 請求,將 model 設為 grok-imagine-text-to-image,並附上描述圖像的提示詞。影片生成請使用 text_to_video 和 grok-imagine-text-to-video。

text_to_image
3

取得結果

API 立即傳回 task_id。輪詢任務狀態端點,直到狀態變為 completed,然後從回應中取得輸出圖像或影片 URL。

task_id: tsk_abc123
參數

Grok Imagine API 參數

參數 類型 說明
model string 必填。例如 grok-imagine-text-to-image、grok-imagine-image-to-video。
prompt string 對所需輸出的文字描述。
image_url string 圖生圖或圖生影片的來源圖像 URL。
aspect_ratio string 選填。輸出長寬比,例如 16:9、1:1。

Hermes Agent 上的 Grok Imagine 是什麼?

Grok Imagine(Aurora)是 xAI 的圖像與影片生成器,涵蓋文生圖、圖像編輯和附帶音訊同步的文生影片。Hermes Agent 透過 custom:runapi provider 呼叫它,方便將 Grok Imagine 的輸出與其他 RunAPI 模型串接,用於多步驟工作流程——例如生成產品照片後,再傳遞給影片模型製作動態內容。

Grok Imagine 使用情境

AI 生成商品照

從文字描述生成電商商品列表、型錄或廣告活動用的商品攝影,無需實體拍攝。

附帶同步音訊的影片短片

從文字提示詞生成附帶匹配音訊的短片,用於社群媒體 Reels、產品預告或內容行銷。

創意專案角色生成

用詳細的文字提示詞,為遊戲、故事或品牌專案生成逼真或動漫風格的一致角色設計。

FAQ

Grok Imagine + Hermes Agent 常見問題

Hermes Agent 通用設定

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

Hermes Agent 設定指南 →

Grok Imagine 模型目錄

查看所有 Grok Imagine 變體、價格和 API 文件。

Grok Imagine 模型 →

立即在 Hermes Agent 中試用 Grok Imagine。

取得免費 RunAPI key,設定 custom:runapi provider,開始使用 xAI Grok Imagine 生成圖像和影片。