---
title: &quot;透過 RunAPI 在 Hermes Agent 中使用 Wan — 影片與圖片 API 指南&quot;
url: &quot;https://runapi.ai/zh-HK/hermes-wan.md&quot;
canonical: &quot;https://runapi.ai/zh-HK/hermes-wan&quot;
locale: &quot;zh-HK&quot;
model: &quot;wan&quot;
---

# 在 Hermes Agent 中使用 Wan。

Wan 是 Alibaba 的開源影片與圖片生成模型，採用 Apache 2.0 授權，在 Artificial Analysis 文生影片排行榜上排名第一。涵蓋 20+ 種變體，從 Wan 2.2 到 2.7 — 文生影片、圖生影片、帶唇形同步的語音生影片、透過 R2V 進行影片編輯，以及最高 4K 的圖片生成。Hermes Agent 透過與聊天相同的 RunAPI custom provider 和 API key 呼叫任何 Wan 端點。

## API example

```bash
curl -X POST https://runapi.ai/api/v1/task/text_to_video \
  -H &quot;Authorization: Bearer $RUNAPI_API_KEY&quot; \
  -H &quot;Content-Type: application/json&quot; \
  -d &#39;{
    &quot;model&quot;: &quot;wan-2.7-text-to-video&quot;,
    &quot;prompt&quot;: &quot;A drone shot rising over terraced rice paddies at golden hour, mist rolling through the valleys, slow upward camera tilt&quot;,
    &quot;output_resolution&quot;: &quot;1080p&quot;
  }&#39;

```

### Response

```json
{
  &quot;task_id&quot;: &quot;tsk_abc123&quot;,
  &quot;status&quot;: &quot;pending&quot;,
  &quot;model&quot;: &quot;wan-2.7-text-to-video&quot;
}

```

## How it works

1. **設定 RunAPI** — 在 Hermes Agent 運行的環境中設定 RUNAPI_API_KEY。如果你已將 RunAPI 新增為 custom:runapi provider，同一把 key 和 base_url 即可處理所有 Wan 端點 — 無需額外設定。
2. **呼叫 Wan 端點** — 向 text_to_video 發送 POST 請求，將 model 設為 wan-2.7-text-to-video、output_resolution 設為 720p 或 1080p。若要圖生影片，使用 wan-2.7-image-to-video 並傳入 first_frame_image_url。若要語音驅動影片，使用 wan-2.2-a14b-speech-to-video-turbo 並傳入 source_audio_url 與 source_image_url。Hermes Agent 會透過 custom:runapi provider 路由所有請求。
3. **輪詢結果** — 端點會立即回傳 task_id。輪詢任務狀態端點，直到狀態為 completed，再從回應中讀取輸出的影片或圖片 URL。RunAPI SDK 與 CLI 會自動處理輪詢。

## Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `model` | `string` | 必填。wan-2.7-text-to-video、wan-2.6-text-to-video、wan-2.5-text-to-video、wan-2.2-a14b-text-to-video-turbo 或 wan-2.7-r2v。 |
| `prompt` | `string` | 必填。期望影片場景的文字描述，包含鏡頭運動、燈光與主體細節。 |
| `output_resolution` | `string` | 選填。Wan 2.5+ 可選 720p 或 1080p。Wan 2.2 另外接受 480p 與 580p。預設為 720p。 |
| `aspect_ratio` | `string` | 選填。僅適用於 wan-2.7-r2v。可選值：16:9、9:16、1:1、4:3、3:4。 |
| `duration_seconds` | `integer` | 選填。僅適用於 wan-2.7-r2v。影片長度（秒），2 至 10。 |
| `seed` | `integer` | 選填。用於確定性輸出的可重現種子值。 |
| `callback_url` | `string` | 選填。任務完成時接收 POST 通知的 Webhook URL。 |

## FAQ

### 我可以從 Hermes Agent 呼叫哪些 Wan 端點？

全部都可以。text_to_video、image_to_video、speech_to_video、text_to_image（Wan 2.7 Image）、edit_video 與 animate。只需設定 RunAPI 為 custom:runapi provider 一次，然後按需切換端點與 model slug — 例如 wan-2.7-text-to-video 用於影片、wan-2.7-image 用於最高 4K 的圖片生成。

### 如何在 Hermes Agent 中將 RunAPI 設定為 custom provider 以使用 Wan？

新增一個 custom:runapi provider 項目，將 base_url 設為 https://runapi.ai/v1，並以你的 RUNAPI_API_KEY 作為 API key。設定完成後，每個 Wan 端點 — 以及所有 113+ 個 RunAPI 模型 — 都可以透過同一個 provider 存取，無需額外外掛。

### Wan 2.5、2.6 與 2.7 有什麼差別？

Wan 2.5 引入了 1080p 輸出。Wan 2.6 新增了影片編輯（R2V）與 flash 變體以加速生成。Wan 2.7 新增圖片生成（wan-2.7-image、wan-2.7-image-pro 最高 4K）、影片編輯（wan-2.7-edit-video），以及在 Artificial Analysis 排行榜上領先的改進文生影片品質。

### Wan 的語音生影片如何運作？

使用 wan-2.2-a14b-speech-to-video-turbo 並傳入 source_audio_url（音訊檔案）與 source_image_url（要驅動的人臉）。Wan 會生成唇形同步影片，讓人臉說出音訊內容。輸出解析度支援 480p、580p 或 720p。

### Wan 是開源的嗎？我可以自建嗎？

是的。Wan 由 Alibaba 以 Apache 2.0 授權發布，模型權重公開可用。透過 RunAPI，你可以跳過 GPU 設定 — 一次 API 呼叫即可生成影片或圖片。如果你因隱私需求需要自建管線，相同的權重可以在你自己的基礎設施上運行。


## Links

- [Hermes Agent 設定指南 →](https://runapi.ai/zh-HK/hermes-agent)
- [Wan on RunAPI →](https://runapi.ai/zh-HK/models/wan)
- [Model catalog](https://runapi.ai/zh-HK/models)
- [API docs](https://runapi.ai/zh-HK/docs)
