> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rivus.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 对口型（lip-sync）

> 使用现有视频与音频/文本生成对口型视频（非 API 规范）

说明

* 路径：`/vidu/ent/v2/lip-sync`（对应官方 `POST https://api.vidu.cn/ent/v2/lip-sync`）。
* 认证：`Authorization: Bearer <kapon Token>`。
* 适用场景：基于已有视频素材和音频/文本生成“对口型”视频。

请求参数（核心）

* `video_url`（必填）：原视频 URL，需可从服务端访问。
* `audio_url`（可选）：音频文件 URL，支持 `wav/mp3/wma/m4a/aac/ogg`。
* `text`（可选）：用于驱动口型的文本内容（可包含停顿标签 `<#x#>`）。
* `speed`（可选）：语速，范围 `[0.5, 2]`，默认 `1.0`，仅文字驱动时生效。
* `voice_id`（可选）：音色 ID，仅文字驱动时生效。
* `ref_photo_url`（可选）：人脸参考图 URL，用于在多张人脸时指定目标人物。
* `volume`（可选）：音量大小，范围 `[0, 10]`，默认 `0` 表示正常音量。
* `callback_url`（可选）：回调地址，Vidu 会在任务状态变化时回调。
* `payload`（可选）：透传字段，会在查询/回调结果中原样返回。

注意：

* 至少需要 `audio_url` 或 `text` 其中之一。
* `video_url` 视频需满足官方规范（编码 H.264，时长 1–600 秒，大小不超过 5G 等）。

调用示例（音频驱动）

```bash theme={null}
curl --request POST \
  --url https://models.kapon.cloud/vidu/ent/v2/lip-sync \
  --header 'Authorization: Bearer <kapon Token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "video_url": "https://your.cdn.com/source.mp4",
  "audio_url": "https://your.cdn.com/audio.wav",
  "callback_url": "https://your.service.com/vidu/callback",
  "payload": "user_123_order_456"
}'
```

调用示例（文本驱动）

```bash theme={null}
curl --request POST \
  --url https://models.kapon.cloud/vidu/ent/v2/lip-sync \
  --header 'Authorization: Bearer <kapon Token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "video_url": "https://your.cdn.com/source.mp4",
  "text": "你好<#2#>我是 Vidu<#1.5#>很高兴见到你",
  "speed": 1.0,
  "voice_id": "your_voice_id",
  "volume": 0
}'
```

返回示例

```json theme={null}
{
  "task_id": "your_task_id_here",
  "state": "created",
  "payload": "user_123_order_456",
  "created_at": "2025-01-01T15:41:31.968916Z"
}
```

后续查询

* 与其它 Vidu 任务保持一致，通过：

```bash theme={null}
curl --request GET \
  --url https://models.kapon.cloud/vidu/ent/v2/tasks/$TASK_ID/creations \
  --header 'Authorization: Bearer <kapon Token>'
```

即可拿到最终生成的视频 URL（`url/cover_url/watermarked_url`）及 `state/credits/payload` 等信息。
