Skip to main content
POST
cURL
当单张源图片不足以满足需求,而你希望 Kling 基于多张图片参考构建运动时,请使用此端点。

调用前准备

  • image_list 中准备 1 到 4 张图片
  • 使用符合 Kling 像素要求的图片;过小的缩略图会被生成任务拒绝
  • 除非你明确需要选择一个与路由兼容的模型,否则请省略 model_name
  • 首次测试请尽量保持简单:简短的 prompt、duration: 5,且不要添加额外的回调设置
  • 不要在此路由中发送图生视频的蒙版字段,例如 static_maskdynamic_masks

任务流程

1

提交多图请求

发送图片列表、prompt 和 duration,然后保存返回的 Kling task_id
2

轮询任务

继续使用获取一个 Kling 任务,直到任务进入终态。
3

保存结果

如果你需要在提供方交付 URL 的保留期限之外继续保存视频,请存储已完成的视频。
完整参数说明请参阅官方 Kling 文档

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

请求体

application/json
image_list
object[]
必填

Input image references. Provide 1 to 4 items that meet Kling pixel requirements; very small thumbnails are rejected.

Required array length: 1 - 4 elements
model_name
enum<string>
默认值:kling-v1-6

Kling model variant for multi-image video. Omit to use kling-v1-6.

可用选项:
kling-v1-6
prompt
string

Text prompt describing the desired motion and scene.

negative_prompt
string

Elements to avoid in the generated video.

mode
enum<string>
默认值:std

Generation mode. Use std or pro; omitted requests use std.

可用选项:
std,
pro
duration
string
默认值:5

Output video length in seconds. Use 5 or 10; omitted requests use 5.

aspect_ratio
enum<string>

Requested frame aspect ratio when the model needs an explicit frame shape.

可用选项:
16:9,
9:16,
1:1
callback_url
string

Webhook URL to receive task status updates.

external_task_id
string

Custom task id for your own tracking. Must be unique per account.

响应

200 - application/json

Task accepted.

code
integer
必填

Error code; specifically define the error code

message
string
必填

error message

data
object
必填