创建参考生视频任务(非主体调用)

POST /ent/v2/reference2video

MethodPOST
Path/ent/v2/reference2video
Typehttp
Status1
Module2102810
Folder76611123

说明

概览

MethodPOST
Path/ent/v2/reference2video
Typehttp
Status1
Module2102810
Folder76611123

参数

{
  "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注:字符长度不能超过 5000 个字符。"
      },
      "model": {
        "type": "string",
        "description": "模型名称可选值:viduq3-mix、viduq3、viduq2-pro、viduq2、viduq1、vidu2.0\n- viduq3-mix:画面质感强,支持智能切镜,支持音画同出,动态效果好,均衡性最强\n- viduq3:支持智能切镜,支持音画同出,多机位的一致性更出色\n- viduq2-pro:支持参考视频,支持视频编辑,视频替换\n- viduq2:动态效果好,生成细节丰富\n- viduq1:画面清晰,平滑转场,运镜稳定\n- vidu2.0:生成速度快"
      },
      "duration": {
        "type": "number",
        "description": "视频时长参数,默认值依据模型而定\nviduq3-mix:默认5秒,可选1 - 16\nviduq3:默认5秒,可选3 - 16\nviduq2-pro、viduq2:默认5秒,可选:1 - 10\nviduq1:默认5秒,可选:5\nvidu2.0:默认4秒,可选:4"
      },
      "seed": {
        "type": "number",
        "description": "随机种子\n当默认不传或者传0时,会使用随机数替代\n手动设置则使用设置的种子"
      },
      "movement_amplitude": {
        "type": "string",
        "description": "运动幅度\n默认 auto,可选值:auto、small、medium、large\n注:q2和q3系列模型不支持该参数"
      },
      "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": "string",
        "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采用回调签名算法进行认证,详情见:回调签名算法"
      },
      "audio": {
        "type": "string",
        "description": "是否使用音视频直出能力,默认为true,枚举值为:\n- false:不需要音视频直出,输出静音视频\n- true:需要音画同步,输出声音的视频(包括台词和音效)\n注:非主体调用时,仅q3模型支持该参数"
      },
      "aspect_ratio": {
        "type": "string",
        "description": "比例参数,q2、q3模型支持任意比例或 auto\n默认 16:9,可选值如下:1:1、9:16、16:9、3:4、4:3\nauto:根据输入图或视频自动推荐"
      },
      "resolution": {
        "type": "string",
        "description": "分辨率参数,默认值依据模型和视频时长而定:\nviduq3-mix(1-16秒):默认 720p, 可选:720p、1080p\nviduq3(3-16秒):默认 720p, 可选:540p、720p、1080p\nviduq2-pro、viduq2 (1-10秒):默认 720p, 可选:540p、720p、1080p\nviduq1 (5秒):默认 1080p, 可选:1080p\nvidu2.0 (4秒):默认 360p, 可选:360p、720p"
      },
      "images": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "图像参考支持多张图片,模型将以此参数中传入的图片中的主题为参考生成具备主体一致的视频,各模型版本可参考图片数量不同,具体要求如下\n注1:viduq3、viduq2、viduq1、vidu2.0系列模型支持上传1~7张图片\n注2:使用viduq2-pro模型时,如果不上传视频,则支持上传1-7张图,如果上传视频则支持1-4张图\n注3:支持传入图片 Base64 编码或图片URL(确保可访问)\n注4:图片支持 png、jpeg、jpg、webp格式\n注5:图片像素不能小于 128*128,且比例需要小于1:4或者4:1\n注6:请注意,http请求的post body不超过20MB,且编码必须包含适当的内容类型字符串,例如:\ndata:image/png;base64,{base64_encode}"
      },
      "videos": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "视频参考支持上传1~2个视频,模型将以此参数中传入的视频作为参考,生成具备主体一致的视频。\n注1: 仅viduq2-pro模型支持该参数\n注2:使用视频参考功能时,最多支持上传 1个8秒 视频 或 2个5秒 视频\n注3:视频支持 mp4、avi、mov格式\n注4:视频像素不能小于 128*128,且比例需要小于1:4或者4:1,且大小不超过100M。\n注5:请注意,base64 decode之后的字节长度需要小于20M,且编码必须包含适当的内容类型字符串,例如:data:video/mp4;base64,{base64_encode}"
      },
      "sounds": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "音频参考支持上传1~7个音频,模型将以此参数中传入的音频作为参考,生成具备主体一致的视频。\n注1:使用音频参考功能时,最多支持上传 7个音频,每个音频时长最多20s\n注2:音频支持 mp3格式\n注3:每个音频文件大小不超过50M。\n注4:请注意,base64 decode之后的字节长度需要小于20M,且编码必须包含适当的内容类型字符串,例如:\ndata:video/mp3;base64,{base64_encode}\n注:目前暂不支持,仅提前预留该参数"
      },
      "bgm": {
        "type": "string",
        "description": "是否为生成的视频添加背景音乐。默认:false,可选值 true 、false\n- 传 true 时系统将从预设 BGM 库中自动挑选合适的音乐并添加;不传或为 false 则不添加 BGM。\n- BGM不限制时长,系统根据视频时长自动适配\n- 该参数在q2系列模型的duration为 9秒 或 10秒 时不生效\n- 该参数在q3系列模型中不生效"
      }
    },
    "required": [
      "model",
      "prompt"
    ],
    "x-apifox-orders": [
      "model",
      "images",
      "videos",
      "sounds",
      "prompt",
      "bgm",
      "audio",
      "duration",
      "seed",
      "aspect_ratio",
      "resolution",
      "movement_amplitude",
      "payload",
      "watermark",
      "wm_position",
      "wm_url",
      "meta_data",
      "callback_url"
    ]
  },
  "required": false,
  "mediaType": "",
  "examples": [
    {
      "mediaType": "application/json",
      "value": "{\r\n    \"model\": \"viduq3-mix\",\r\n    \"images\": [\r\n        \"https://picx.zhimg.com/v2-4911df093b40ee5511938a1ac2a5cdc4_r.jpg\"\r\n    ],\r\n    \"prompt\": \"一只可爱的cat在草地上奔跑,阳光明媚,画面温馨\"\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\": \"911084878697623552\",\r\n    \"type\": \"character2video\",\r\n    \"state\": \"created\",\r\n    \"model\": \"viduq2\",\r\n    \"style\": \"general\",\r\n    \"prompt\": \"一只可爱的@cat在草地上奔跑,阳光明媚,画面温馨\",\r\n    \"images\": [\r\n        \"https://picx.zhimg.com/v2-4911df093b40ee5511938a1ac2a5cdc4_r.jpg\"\r\n    ],\r\n    \"duration\": 5,\r\n    \"seed\": 1830691647,\r\n    \"aspect_ratio\": \"16:9\",\r\n    \"resolution\": \"720p\",\r\n    \"movement_amplitude\": \"auto\",\r\n    \"created_at\": \"2026-01-20T06:37:57.371761937Z\",\r\n    \"credits\": 45,\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
  }
]