创建首尾帧生视频任务
POST /ent/v2/start-end2video
说明
概览
| Method | POST |
|---|---|
| Path | /ent/v2/start-end2video |
| Type | http |
| Status | 1 |
| Module | 2102810 |
| Folder | 76611123 |
参数
{ "query": [], "path": [], "cookie": [], "header": [ { "required": false, "description": "", "type": "string", "id": "Jsj23RwEo1", "enable": true, "name": "Authorization", "sampleValue": "Bearer {{YOUR_API_KEY}}" }, { "required": false, "description": "", "type": "string", "id": "jjYSOg2NrR", "enable": true, "name": "Content-Type", "sampleValue": "application/json" } ] }
请求体
{ "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", "properties": { "prompt": { "type": "string", "description": "文本提示词\n生成视频的文本描述。\n注:字符长度不能超过 2000 个字符" }, "model": { "type": "string", "description": "模型名称\n可选值:viduq2 、viduq1、viduq3-turbo、viduq3-pro\n- viduq3-turbo:对比viduq3-pro,生成速度更快\n- viduq3-pro:高效生成优质音视频内容,让视频内容更生动、更形象、更立体,效果更好\n- viduq2:最新模型\n- viduq1:画面清晰,平滑转场,运镜稳定" }, "duration": { "type": "integer", "description": "视频时长参数,默认值依据模型而定:\n- viduq3-pro 、viduq3-turbo默认为 5,可选:1 - 16\n- viduq2 : 默认5秒,可选:1-10\n- viduq1 : 默认5秒,可选:5" }, "seed": { "type": "string", "description": "随机种子\n当默认不传或者传0时,会使用随机数替代\n手动设置则使用设置的种子" }, "movement_amplitude": { "type": "string", "description": "分辨率参数,默认值依据模型和视频时长而定:\nviduq2 (1-10秒):默认 720p, 可选:540p、720p、1080p\nviduq1 (5秒):默认 1080p, 可选:1080p\nvidu2.0 (4秒):默认 360p, 可选:360p、720p" }, "payload": { "type": "string", "description": "透传参数\n不做任何处理,仅数据传输\n注:最多 1048576个字符" }, "watermark": { "type": "string", "description": "是否添加水印\n- true:添加水印;\n- false:不添加水印;\n注1:目前水印内容为固定,内容由AI生成,默认不加\n注2:您可以通过watermarked_url参数查询获取带水印的视频内容,详情见查询任务接口" }, "wm_position": { "type": "integer", "description": "水印位置,表示水印出现在图片的位置,可选项为:\n1:左上角\n2:右上角\n3:右下角\n4:左下角\n默认为:3" }, "wm_url": { "type": "string", "description": "水印内容,此处为图片URL\n不传时,使用默认水印:内容由AI生成" }, "meta_data": { "type": "string", "description": "元数据标识,json格式字符串,透传字段,您可以 自定义格式 或使用 示例格式 ,示例如下:\n{\n\"Label\": \"your_label\",\"ContentProducer\": \"yourcontentproducer\",\"ContentPropagator\": \"your_content_propagator\",\"ProduceID\": \"yourproductid\", \"PropagateID\": \"your_propagate_id\",\"ReservedCode1\": \"yourreservedcode1\", \"ReservedCode2\": \"your_reserved_code2\"\n}\n该参数为空时,默认使用vidu生成的元数据标识" }, "callback_url": { "type": "string", "description": "Callback 协议\n需要您在创建任务时主动设置 callback_url,请求方法为 POST,当视频生成任务有状态变化时,Vidu 将向此地址发送包含任务最新状态的回调请求。回调请求内容结构与查询任务API的返回体一致\n回调返回的\"status\"包括以下状态:\n- processing 任务处理中\n- success 任务完成(如发送失败,回调三次)\n- failed 任务失败(如发送失败,回调三次)\nVidu采用回调签名算法进行认证,详情见:回调签名算法" }, "images": { "type": "array", "items": { "type": "object", "properties": {}, "x-apifox-orders": [] }, "description": "图像\n支持输入两张图,上传的第一张图片视作首帧图,第二张图片视作尾帧图,模型将以此参数中传入的图片来生成视频\n\n注1: 首尾帧两张输入图的分辨率需相近,首帧图的分辨率/尾帧图的分辨率要在0.8~1.25之间。且图片比例需要小于1:4或者4:1;\n注2: 支持传入图片 Base64 编码或图片URL(确保可访问);\n注3: 图片支持 png、jpeg、jpg、webp格式;\n注4: 图片大小不超过50M;\n注5: 请注意,http请求的post body不超过20MB,且编码必须包含适当的内容类型字符串,例如:\n\ndata:image/png;base64,{base64_encode}" }, "is_rec": { "type": "string", "description": "是否使用推荐提示词\n- true:是,由系统自动推荐提示词,并使用提示词内容生成视频,推荐提示词数量=1\n- false:否,根据输入的prompt生成视频\n注意:启用推荐提示词后,每个任务多消耗10积分" }, "resolution": { "type": "string", "description": "分辨率参数,默认值依据模型和视频时长而定:\n- viduq3-pro 、viduq3-turbo1-16秒:默认 720p,可选:540p、720p、1080p\n- viduq2-pro-fast 1-8秒:默认 720p,可选:720p、1080p\n- viduq2-pro 1-8秒:默认 720p,可选:540p、720p、1080p\n- viduq2-turbo 1-8秒:默认 720p,可选:540p、720p、1080p\n- viduq1 和 viduq1-classic 5秒:默认 1080p,可选:1080p\n- vidu2.0 4秒:默认 360p,可选:360p、720p、1080p\n- vidu2.0 8秒:默认 720p,可选:720p" }, "bgm": { "type": "string", "description": "是否为生成的视频添加背景音乐。\n默认:false,可选值 true 、false\n- 传 true 时系统将从预设 BGM 库中自动挑选合适的音乐并添加;不传或为 false 则不添加 BGM。\n- BGM不限制时长,系统根据视频时长自动适配" } }, "required": [ "model", "prompt", "images" ], "x-apifox-orders": [ "model", "images", "prompt", "is_rec", "duration", "seed", "resolution", "movement_amplitude", "bgm", "payload", "watermark", "wm_position", "wm_url", "meta_data", "callback_url" ] }, "required": false, "mediaType": "", "examples": [ { "mediaType": "application/json", "value": "{\r\n \"task_id\": \"911088422699962368\",\r\n \"type\": \"headtailimg2video\",\r\n \"state\": \"created\",\r\n \"model\": \"viduq1\",\r\n \"style\": \"general\",\r\n \"prompt\": \"采蘑菇的小姑娘,上山采蘑菇,遇到了比自己还大的蘑菇\",\r\n \"images\": [\r\n \"https://storage.xuanxu.net/images/1997560136907759618/1768223244152.png\",\r\n \"https://storage.xuanxu.net/images/1997560136907759618/1768223372503.png\"\r\n ],\r\n \"duration\": 5,\r\n \"seed\": 722073967,\r\n \"aspect_ratio\": \"\",\r\n \"resolution\": \"1080p\",\r\n \"movement_amplitude\": \"auto\",\r\n \"created_at\": \"2026-01-20T06:52:02.323137590Z\",\r\n \"credits\": 80,\r\n \"payload\": \"\",\r\n \"cus_priority\": 0,\r\n \"off_peak\": false,\r\n \"watermark\": false,\r\n \"is_rec\": false,\r\n \"wm_position\": 1,\r\n \"wm_url\": \"\",\r\n \"meta_data\": \"\",\r\n \"client_request_id\": \"\"\r\n}" } ], "oasExtensions": "" }
响应
[ { "id": 755089939, "name": "成功", "code": 200, "contentType": "json", "jsonSchema": { "type": "object", "properties": { "task_id": { "type": "string" }, "type": { "type": "string" }, "state": { "type": "string" }, "model": { "type": "string" }, "style": { "type": "string" }, "prompt": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "duration": { "type": "integer" }, "seed": { "type": "integer" }, "aspect_ratio": { "type": "string" }, "resolution": { "type": "string" }, "movement_amplitude": { "type": "string" }, "created_at": { "type": "string" }, "credits": { "type": "integer" }, "payload": { "type": "string" }, "cus_priority": { "type": "integer" }, "off_peak": { "type": "boolean" }, "watermark": { "type": "boolean" }, "is_rec": { "type": "boolean" }, "wm_position": { "type": "string" }, "wm_url": { "type": "string" }, "meta_data": { "type": "string" }, "client_request_id": { "type": "string" } }, "required": [ "task_id", "type", "state", "model", "style", "prompt", "images", "duration", "seed", "aspect_ratio", "resolution", "movement_amplitude", "created_at", "credits", "payload", "cus_priority", "off_peak", "watermark", "is_rec", "wm_position", "wm_url", "meta_data", "client_request_id" ], "x-apifox-orders": [ "task_id", "type", "state", "model", "style", "prompt", "images", "duration", "seed", "aspect_ratio", "resolution", "movement_amplitude", "created_at", "credits", "payload", "cus_priority", "off_peak", "watermark", "is_rec", "wm_position", "wm_url", "meta_data", "client_request_id" ] }, "itemSchema": {}, "description": "", "mediaType": "", "headers": [], "oasExtensions": "" } ]
响应示例
[ { "name": "成功示例", "responseId": 755089939, "data": "{\r\n \"task_id\": \"911088422699962368\",\r\n \"type\": \"headtailimg2video\",\r\n \"state\": \"created\",\r\n \"model\": \"viduq1\",\r\n \"style\": \"general\",\r\n \"prompt\": \"采蘑菇的小姑娘,上山采蘑菇,遇到了比自己还大的蘑菇\",\r\n \"images\": [\r\n \"https://storage.xuanxu.net/images/1997560136907759618/1768223244152.png\",\r\n \"https://storage.xuanxu.net/images/1997560136907759618/1768223372503.png\"\r\n ],\r\n \"duration\": 5,\r\n \"seed\": 722073967,\r\n \"aspect_ratio\": \"\",\r\n \"resolution\": \"1080p\",\r\n \"movement_amplitude\": \"auto\",\r\n \"created_at\": \"2026-01-20T06:52:02.323137590Z\",\r\n \"credits\": 80,\r\n \"payload\": \"\",\r\n \"cus_priority\": 0,\r\n \"off_peak\": false,\r\n \"watermark\": false,\r\n \"is_rec\": false,\r\n \"wm_position\": \"unspecified\",\r\n \"wm_url\": \"\",\r\n \"meta_data\": \"\",\r\n \"client_request_id\": \"\"\r\n}", "description": "", "oasKey": "", "oasExtensions": "", "id": 671652211 } ]