图生视频
指定生成式任务中要使用的具体模型名称,用于确定调用哪个模型来执行生成任务,支持选择“Wan2.1-I2V-14B-480P、Wan2.1-I2V-14B-720P、Wan2.2-I2V-5B、Wan2.2-I2V-A14B”。更多模型,可参考支持的模型。
指定生成式模型需执行的任务类型,用于明确模型的工作目标,指定img2video。
允许强制模型产生特定的输出格式。
输入参数集合。
单张图片。
是生成视频时用于描述期望内容(如场景、风格、细节等)的正向提示词。
用于指定生成视频时需避免的元素(如低质量、失真等)的反向提示词,以优化生成结果的质量。
分辨率(480p、720p、1080p)。
宽高比(4:3、3:4、16:9、9:16、21:9、1:1)。若直接提供了 width(宽度)和 height(高度)的具体像素值,系统将直接采用此设定。若未直接指定宽高,但同时提供了 resolution 和 aspect_ratio,系统将根据这两者自动计算出对应的宽高值。例如 16:9 + 720p,计算结果为 1280*720;如9:16 + 720p,计算结果为 720*1280。
指定生成视频的数量,用于控制一次请求返回的视频总数,不传,则默认生成一个视频。
指导尺度(通常 1.0 ~ 20.0,常用范围5.0 ~ 15.0):3.0 - 7.0表示获得更多意外惊喜和创意组合;7.0 - 10.0表示在遵循提示词和图像质量间取得平衡;10.0 - 15.0表示严格遵循文本描述,适合产品设计;1.0 - 5.0表示获得更抽象、interpretive的结果。
视频时常。
推理步数。
帧率/帧每秒帧率。
异步函数。
表示请求处理状态的状态码。
返回请求的处理结果,通常配合状态码使用,直观告知用户当前请求的具体情况。
任务的核心结果数据。
任务的唯一标识ID。
任务的执行状态。
任务完成进度。
任务返回的结果。
是生成视频的网络访问链接,通过该URL可直接下载或在线查看视频文件,适合需要快速预览或通过链接分享的场景。
响应的时间戳。
curl --location --request POST 'https://cloud.baicaiinfer.com/v1/videos/generations' \
--header 'Authorization: Bearer sk-RVkVZVd57hLruMHEu9t*****' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host: cloud.baicaiinfer.com' \
--header 'Connection: keep-alive' \
--data-raw '{
"selected_model": "Wan2.1-I2V-14B-480P",
"task_type": "img2video",
"response_format":"url",
"input": {
"image": "5dff580acf464916b43c2263d6900817/762*****.JPG",
"prompt": "An astronaut hatching from an egg, on the surface of the moon, the darkness and depth of space realised in the background. High quality, ultrarealistic detail and breath-taking movie-like camera shot.",
"negative_prompt": "Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards",
"resolution": "480p",
"aspect_ratio": "4:3",
"number_of_videos": 2,
"true_cfg_scale": 5,
"duration": 5,
"num_inference_steps": 30,
"fps":16
},
"async": true
}'
{
"code": "String",
"message": "String",
"data": {
"taskId": "String"
},
"ts": "String"
}