多图生视频
接口:POST /qwen/api/v1/services/aigc/video-generation/video-synthesis 归属:视频模型/qwen视频模型 调用地址:Base URL https://api.allyang.cn(OpenAI 兼容前缀 https://api.allyang.cn/v1)+ 上述路径 鉴权:请求头 Authorization: Bearer <你的令牌>;令牌在控制台「令牌管理」创建 说明:下方为本接口契约。路径、字段名与枚举取值与线上接口一致;叙述文字已按本平台口径重写。价格、并发与限流等数值以控制台及实际返回为准,未确认处标注「待补」。
OpenAPI Specification
yaml
openapi: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/qwen/api/v1/services/aigc/video-generation/video-synthesis:
post:
summary: 多图生视频
description: "传入多张图片与提示词,即可生成一段过渡平滑的视频。"
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:
function:
type: string
description: "功能名称,多图参考固定为 image_reference。多图参考最多支持 3 张参考图,图像内容可含主体与背景(人物、动物、服饰、场景等);用 prompt 描述期望画面,模型会把多张图融合成连贯视频。"
prompt:
type: string
description: "提示词,描述期望在视频中出现的元素与视觉特点。中英文均可,不超过 800 字符,每个汉字或字母计一个字符,超出自动截断。写法建议见文生视频/图生视频 Prompt 指南。"
ref_images_url:
type: array
items:
type: string
description: "参考图像 URL 数组,地址需公网可访问(HTTP/HTTPS);本地文件先上传换取临时 URL。仅前 3 张生效,超出部分忽略。限制:格式 JPG、JPEG、PNG、BMP、TIFF、WEBP;宽高均落在 [360, 2000] 像素;单张不超过 10MB;地址不得含中文。建议:作为主体参考时每张图仅放一个主体;作为背景参考时背景图最多一张且不含主体,纯色背景(白色或单一颜色)更易突出主体。"
required:
- function
- prompt
- ref_images_url
parameters:
type: object
properties:
prompt_extend:
type: boolean
description: "是否开启 prompt 智能改写:开启后由大模型改写输入 prompt,对较短 prompt 效果提升明显,但会略增耗时。true(默认)开启改写,false 关闭。"
obj_or_bg:
type: array
items:
type: string
description: "与 ref_images_url 一一对应的用途标记,逐个元素指明该位置的图像作主体还是背景:obj 为主体参考,bg 为背景参考(最多一个)。建议传入,且数组长度必须与 ref_images_url 相同,否则报错;仅当 ref_images_url 只有一个元素时可不传,默认取 [“obj”]。示例值:[“obj”, “obj”, “bg”]。"
size:
type: string
description: "生成视频分辨率(宽*高)。当前仅支持 720P 档,可选:1280*720(默认,宽高比 16:9,前者为宽、后者为高)、720*1280(9:16)、960*960(1:1)、832*1088(3:4)、1088*832(4:3)。"
duration:
type: integer
description: "视频生成时长,单位秒。当前固定为 5,不可修改,模型始终输出 5 秒视频。"
seed:
type: integer
description: "随机数种子,用于控制生成内容的随机性,取值区间 [0, 2147483647]。不传时由算法自动生成;希望结果相对稳定可复用同一 seed 值。"
watermark:
type: boolean
description: "是否添加水印标识,水印落在图片右下角,文案为“AI生成”。false(默认)不加,true 添加。"
required:
- model
- input
example:
model: wanx2.1-vace-plus
input:
function: image_reference
prompt: >-
视频中,一位女孩自晨雾缭绕的古老森林深处款款走出,她步伐轻盈,镜头捕捉她每一个灵动瞬间。当女孩站定,环顾四周葱郁林木时,她脸上绽放出惊喜与喜悦交织的笑容。这一幕,定格在了光影交错的瞬间,记录下女孩与大自然的美妙邂逅。
ref_images_url:
- >-
https://api.allyang.cn/<外部地址已按合规要求移除>
- >-
https://api.allyang.cn/<外部地址已按合规要求移除>
parameters:
prompt_extend: true
obj_or_bg:
- obj
- bg
size: 1280*720
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties: {}
headers: {}
security: []
components:
schemas: {}
securitySchemes: {}
servers: []
security: []