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

# 视频替换

> 替换视频中的主体对象

## 概述

视频替换（replace）用于将视频中的主体替换为指定图片中的对象。

> \[!NOTE]
>
> * **本平台接口**：`POST https://models.hingnet.com.cn/vidu/ent/v2/replace`
> * **官方接口**：`POST https://api.vidu.cn/ent/v2/replace`，详见 [官方 API 文档](https://platform.vidu.cn/docs/video-replacement)

## 请求参数

| 参数             | 类型     | 必填 | 说明                    |
| -------------- | ------ | -- | --------------------- |
| `video_url`    | string | ✅  | 原视频 URL               |
| `object`       | string | ✅  | 原视频主体描述（≤ 100 字符）     |
| `image`        | string | ✅  | 替换主体图片 URL 或 Base64   |
| `prompt`       | string | ❌  | 描述要生成的视频内容（≤ 2000 字符） |
| `start_from`   | int    | ❌  | 从第几秒开始替换              |
| `payload`      | string | ❌  | 透传参数                  |
| `callback_url` | string | ❌  | 回调地址                  |

## 调用示例

```bash theme={null}
curl -X POST "https://models.hingnet.com.cn/vidu/ent/v2/replace" \
  -H "Authorization: Bearer <HingNet AI Token>" \
  -H "Content-Type: application/json" \
  -d '{
    "video_url": "https://your.cdn.com/original.mp4",
    "object": "蓝色裙子",
    "image": "https://your.cdn.com/subject.png",
    "prompt": "一个女人穿着橙色的小裙子在跳舞",
    "start_from": 3
  }'
```

## 计费说明

| 能力   | 计费规则              |
| ---- | ----------------- |
| 视频替换 | 每生成 1 个任务，扣 80 积分 |

## 返回示例

```json theme={null}
{
  "task_id": "your_task_id",
  "state": "created",
  "duration": 7,
  "credits": 80,
  "created_at": "2025-01-01T06:48:29.368Z"
}
```

## 素材要求

### 视频要求

* 时长：2–10 秒
* 清晰度：480p–1080p

### 图片要求

* 格式：png / jpeg / jpg / webp
* 数量：仅 1 张
* 比例：小于 1:4 或 4:1
* 大小：≤ 50MB
* 清晰度：360p–1080p
* Base64 格式需包含前缀：`data:image/png;base64,{base64_encode}`

## 查询结果

任务创建成功后，通过 [任务查询](/vidu/video-query) 接口获取最终结果。
