首尾帧生成视频
OpenAPI Specification
yaml
openapi: 3.0.1
info:
title: ''
description: "本页接口说明详见下方接口定义;参数取值与返回以本平台实测为准。"
version: 1.0.0
paths:
/qwen/api/v1/services/aigc/image2video/video-synthesis:
post:
summary: 首尾帧生成视频
deprecated: false
description: "通义万相首尾帧生视频模型基于首帧图像、尾帧图像与文本提示词生成平滑过渡的视频。基础能力:视频时长固定 5 秒、可选分辨率 480P/720P/1080P、智能改写 prompt、添加水印;特效模板:仅输入首帧图片并选择模板即可生成特定动态效果。参数与返回以本平台实测为准。"
tags:
- 视频模型/qwen视频模型
parameters:
- name: X-DashScope-Async
in: header
description: "该字段的取值与含义以本平台实际返回为准。"
required: true
example: enable
schema:
type: string
- name: Content-Type
in: header
description: "该字段的取值与含义以本平台实际返回为准。"
required: true
example: application/json
schema:
type: string
- name: Authorization
in: header
description: "该字段的取值与含义以本平台实际返回为准。"
required: false
example: Bearer {{YOUR_API_KEY}}
schema:
type: string
default: Bearer {{YOUR_API_KEY}}
requestBody:
content:
application/json:
schema:
type: object
properties:
model:
type: string
input:
type: object
properties:
first_frame_url:
type: string
description: "首帧图像 URL 或 Base64,输出视频宽高比以该图像为基准。限制:格式 JPEG、JPG、PNG(不支持透明通道)、BMP、WEBP;宽高均在 360–2000 像素;不超过 10MB;URL 需公网可访问(HTTP/HTTPS),本地文件可先上传获取临时 URL。"
last_frame_url:
type: string
description: "尾帧图像 URL 或 Base64。限制:格式 JPEG、JPG、PNG(不支持透明通道)、BMP、WEBP;宽高均在 360–2000 像素,可与首帧分辨率不同、无需强制对齐;不超过 10MB;URL 需公网可访问。"
prompt:
type: string
description: "文本提示词,支持中英文,长度不超过 800 个字符,超出部分自动截断。若首尾帧的主体或场景变化较大,建议描写变化过程(如运镜过程、主体运动过程)。"
negative_prompt:
type: string
description: "反向提示词,用于描述不希望在视频画面中出现的内容;支持中英文,长度不超过 500 个字符,超出部分自动截断。"
template:
type: string
description: "视频特效模板的名称;使用该参数时仅需传入 first_frame_url。不同模型支持的特效模板不同,调用前请对照视频特效列表以免调用失败。"
required:
- first_frame_url
parameters:
type: object
properties:
resolution:
type: string
description: "生成视频的分辨率档位,仅用于调整清晰度(总像素),不改变宽高比(与首帧图像保持一致)。可用取值依赖 model:wan2.2-kf2v-flash 支持 480P、720P、1080P,默认 720P;wanx2.1-kf2v-plus 支持 720P,默认 720P。"
prompt_extend:
type: boolean
description: "是否开启 prompt 智能改写:true(默认)开启,对较短 prompt 提升明显但会增加耗时;false 不开启。"
duration:
type: integer
description: "视频时长,单位秒;当前固定为 5 且不支持修改,模型始终输出 5 秒视频"
watermark:
type: boolean
description: "是否添加水印,水印位于画面右下角,文案为「AI 生成」。false(默认)不添加,true 添加。"
seed:
type: integer
description: "随机数种子,取值范围 [0, 2147483647];未指定时系统自动生成。建议固定 seed 以提升可复现性;由于模型生成具有概率性,相同 seed 也不保证结果完全一致。"
required:
- model
- input
- parameters
example:
model: wan2.2-kf2v-flash
input:
first_frame_url: https://files.example.com/material/20250318/first_frame.png
last_frame_url: https://files.example.com/material/20250318/last_frame.png
prompt: 写实风格,一只黑色小猫好奇地看向天空,镜头从平视逐渐上升,最后俯拍它的好奇的眼神。
parameters:
resolution: 480P
prompt_extend: true
responses:
'200':
description: "该字段的取值与含义以本平台实际返回为准。"
content:
application/json:
schema:
type: object
properties: {}
headers: {}
security: []
components:
schemas: {}
securitySchemes: {}
servers: []
security: []
使用提示:本页接口的 Base URL 为
https://api.allyang.cn,请求头需携带Authorization: Bearer <令牌>(令牌在控制台「令牌管理」中创建)。示例中的任务 ID、时间戳与文件地址均为示意值,实际以平台返回为准。模型名请在「模型广场」复制后填入,不要手输;计费、限流与在售清单以平台实测为准(部分数值待补)。