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

# Vidu 2.0 图生视频

Vidu 2.0 图生视频将静态图像转换为动态视频，融入创意故事叙述和动画效果。

<Tip>
  这是一个**异步**API，只会返回异步任务的 task\_id。您应该使用该 task\_id 请求 [查询任务结果 API](/models/reference-get-async-task-result) 来检索视频生成结果。
</Tip>

## 请求头

<ParamField header="Content-Type" type="string" required={true}>
  枚举值: `application/json`
</ParamField>

<ParamField header="Authorization" type="string" required={true}>
  Bearer 身份验证格式，例如：Bearer \{\{API 密钥}}。
</ParamField>

## 请求体

<ParamField body="images" type="string[]" required={true}>
  用作生成视频起始帧的图像。

  图像字段要求：

  * 仅接受 1 张图像
  * 支持公共 URL 或 Base64 格式
  * 支持格式：png、jpeg、jpg、webp
  * 图像宽高比必须小于 1:4 或 4:1
  * 所有图像限制为 50MB
  * base64 解码后的长度必须小于 10MB，且必须包含适当的内容类型字符串。例如：

  ```
  data:image/png;base64,{base64_encode}
  ```
</ParamField>

<ParamField body="prompt" type="string" required={false}>
  视频生成的文本提示词，最大长度为 1500 个字符。
</ParamField>

<ParamField body="duration" type="integer" required={false}>
  视频持续时间（秒）。默认为 4 秒，可选 `4` 秒或 `8` 秒。
</ParamField>

<ParamField body="seed" type="integer" required={false}>
  视频生成的随机种子。

  * 默认为随机种子数值
  * 手动设置的值将覆盖默认的随机种子
</ParamField>

<ParamField body="resolution" type="string" required={false}>
  基于时长的分辨率选项：

  * 4秒：默认 360p，可选 `360p`、`720p`、`1080p`
  * 8秒：默认 720p，可选 `720p`
</ParamField>

<ParamField body="movement_amplitude" type="string" required={false}>
  画面中物体的运动幅度。默认值：`auto`<br />
  可选值：`auto`、`small`、`medium`、`large`
</ParamField>

<ParamField body="bgm" type="boolean" required={false}>
  是否为生成的视频添加背景音乐。默认值：`false`<br />
  可选值：`true`、`false`

  当设置为 true 时，系统将自动添加合适的 BGM。BGM 无时长限制，系统会自动适配。
</ParamField>

<ParamField body="watermark" type="boolean" required={false} default={false}>
  为生成的视频添加水印。

  * `false`：不添加水印。
  * `true`：在视频添加文字的水印，标识由人工智能生成合成。
</ParamField>

## 响应

<ResponseField name="task_id" type="string" required={true}>
  异步任务的 task\_id。您应该使用该 task\_id 请求 [查询任务结果 API](/models/reference-get-async-task-result) 以获取生成结果
</ResponseField>
