创建 Kling Motion Control 任务
通过兼容的 CometAPI 路由,根据角色图像和参考动作视频创建 Kling Motion Control 任务。
所需媒体
image_url 接受公共 URL 或原始 Base64 字符串。
- 使用不超过 10 MB 的 JPG、JPEG 或 PNG 图像。
- 将每个图像维度设为 300 至 65,536 像素。
- 使用 1:2.5 至 2.5:1 的宽高比。
- 将 Base64 作为原始编码字符串发送,不要添加
data:image/...;base64,前缀。 - 展示一名无遮挡的角色,身体取景应与动作 参考相匹配。
video_url 接受公共 MP4 或 MOV URL。
- 使用不超过 100 MB 的视频。
- 将短边设为至少 340 像素。
- 将长边设为不超过 3850 像素。
- 使用仅有一名可见角色的连续镜头。
- 避免剪辑、镜头变化和过快的动作。
task_status。外层
HTTP 200 或响应 code: 0 确认的是查询响应,而不是
成功的生成结果。设置 orientation 值
character_orientation 为必填项,且接受 image 或 video。
element_list,则将 character_orientation 设为 video。
选择模型和模式
兼容路由接受kling-v2-6 和 kling-v3。这两个模型值
均接受以下两种模式值:
model_name,请求将使用 kling-v2-6。如省略 mode,
请求将使用 std。kling-v3 值会保持兼容请求结构
如本页所述;它不会选择独立的 Kling 3.0 路径版本
合约。
兼容合约不保证固定的输出分辨率。如果应用需要特定尺寸,请检查
每个返回的视频。
keep_original_sound 接受 yes 或 no。如果省略此字段,请求
将使用 yes。
任务流程
提交 Motion Control 请求
task_id。轮询任务
task_id。
持续查询,直至状态为 succeed 或 failed。存储结果
可选字段
回调结构
旧版回调架构具有以下结构:submitted、processing、succeed 或 failed。
终态结果字段仅会在返回终态时出现。
结果字段
submitted、processing、succeed 或 failed。
授权
Bearer authentication. Use your CometAPI API key.
请求体
Character image as a public URL or a raw Base64 string. Send raw Base64 without a data:image/...;base64, prefix; data-URI input is outside the compatible contract. Supported formats are JPG, JPEG, and PNG. The image must be 10 MB or smaller. Its width and height must each be from 300 through 65,536 pixels, and its aspect ratio must be between 1:2.5 and 2.5:1.
Public reference motion video URL. Use an MP4 or MOV file that is 100 MB or smaller. The short edge must be at least 340 pixels, and the long edge must not exceed 3850 pixels. The video must be at least 3 seconds long. The maximum duration depends on character_orientation.
Required compatible string enum. With image, the reference video can be 3 to 10 seconds long. With video, the reference video can be 3 to 30 seconds long.
image, video Model ID for this compatible Motion Control request. Omit this field to use kling-v2-6. The kling-v3 value keeps this compatible request shape; it does not select the separate Kling 3.0 path-version contract.
kling-v2-6, kling-v3 Optional text field in the compatible request structure. Maximum 2500 characters.
2500Compatible string enum. Accepted values are yes and no. Omitted requests use yes.
yes, no Both compatible models accept std and pro. Omitted requests use std.
std, pro Optional callback field in the compatible structure. Provide a URI, or omit the field or send an empty string when no callback URI is configured.
Optional ID for correlation in your application. The value must be unique for your account. Store the returned task_id for CometAPI status queries.
Optional compatible Element structure. Provide at most one object, and combine this field only with character_orientation: video.
1Optional compatible watermark structure.