wan2.7-i2v
wan2.7-i2v 统一入口调用说明
- 该内容为平台
/v1/videos统一入口的参数说明使用。 - 可采用原生参数调用 Wan 系列模型,参考:阿里格式(视频)。
基础信息
| 项目 | 说明 |
|---|---|
| 模型名称 | wan2.7-i2v |
| 模型 ID | wan2.7-i2v |
| 模型类型 | 图生视频 |
| Base URL | https://api-platform.ope.ai |
| 创建任务 | POST /v1/videos |
| 查询任务 | GET /v1/videos/{task_id} |
| 下载结果 | GET /v1/videos/{task_id}/content |
鉴权方式:
Authorization: Bearer YOUR_API_KEY
建议先在 shell 里准备两个变量:
BASE_URL="https://api-platform.ope.ai"
API_KEY="YOUR_API_KEY"
价格信息请查看:模型价格。
1. 统一入口与阿里字段映射
wan2.7-i2v 在平台上 采用统一视频入口 POST /v1/videos。网关会把统一请求映射到阿里百炼视频协议(异步任务)。
| 统一入口字段 | 上游阿里字段 | 说明 |
|---|---|---|
model | model | 传 wan2.7-i2v |
prompt | input.prompt | 文本提示词 |
input_reference.content 首个 image_url.url | input.media[0].url | 自动映射为首帧图 |
| - | input.media[0].type | 网关固定写入 first_frame |
size | parameters.size | 例如 1280x720 |
seconds | parameters.duration | 字符串秒数会转成整数 |
generate_audio | parameters.audio | 可选,是否生成音频 |
seed | parameters.seed | 可选,随机种子 |
说明:
- 对
wan2.7-i2v,统一入口当前主要消费第一张image_url作为首帧参考图。 resolution+ratio是 Seedance(火山/Gravitex)能力,不适用于阿里视频通道。- 顶层
content不支持;请使用input_reference.content。
2. 创建任务(POST /v1/videos)
2.1 推荐请求体
{
"model": "wan2.7-i2v",
"prompt": "让画面中的角色向前走两步,镜头轻微推进,电影感光影。",
"size": "1280x720",
"seconds": "5",
"generate_audio": false,
"input_reference": {
"content": [
{
"type": "image_url",
"role": "first_frame",
"image_url": {
"url": "https://example.com/first-frame.png"
}
}
]
}
}
2.2 cURL 示例
curl --request POST "$BASE_URL/v1/videos" \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "wan2.7-i2v",
"prompt": "让画面中的角色向前走两步,镜头轻微推进,电影感光影。",
"size": "1280x720",
"seconds": "5",
"generate_audio": false,
"input_reference": {
"content": [
{
"type": "image_url",
"role": "first_frame",
"image_url": {
"url": "https://example.com/first-frame.png"
}
}
]
}
}'
典型响应:
{
"id": "0385dc79-5ff8-4d82-bcb6-xxxxxx",
"object": "video",
"status": "QUEUED",
"created_at": 1780021218,
"model": "wan2.7-i2v",
"prompt": "让画面中的角色向前走两步,镜头轻微推进,电影感光影。",
"size": "1280x720",
"seconds": "5"
}
id 就是后续查询和下载使用的 task_id。
3. 查询任务(GET /v1/videos/{task_id})
curl --request GET "$BASE_URL/v1/videos/TASK_ID_HERE" \
--header "Authorization: Bearer $API_KEY"
典型响应:
{
"id": "0385dc79-5ff8-4d82-bcb6-xxxxxx",
"status": "IN_PROGRESS",
"model": "wan2.7-i2v",
"created_at": 1780021218,
"object": "video",
"prompt": "让画面中的角色向前走两步,镜头轻微推进,电影感光影。",
"size": "1280x720"
}
常见状态:
QUEUEDIN_PROGRESSSUCCESSFAILURE
4. 下载结果(GET /v1/videos/{task_id}/content)
任务状态为 SUCCESS 后,调用下载接口获取二进制视频流:
curl --request GET "$BASE_URL/v1/videos/TASK_ID_HERE/content" \
--header "Authorization: Bearer $API_KEY" \
--output output.mp4
如果任务尚未完成,接口会返回错误。
5. 最小联调顺序
建议按下面顺序验证:
- 先用单图首帧创建任务(
POST /v1/videos) - 轮询查询状态(
GET /v1/videos/{task_id}) - 成功后下载结果(
GET /v1/videos/{task_id}/content)
6. 官方参考
- 阿里百炼控制台 API 文档(wan2.7-i2v):https://bailian.console.alibabacloud.com/cn-beijing?tab=api#/api/?type=model&url=3025059
- 阿里云帮助中心(图生视频 API):https://help.aliyun.com/zh/model-studio/image-to-video-general-api-reference