Skip to main content
  • 路径 POST /kling/v1/videos/image2video
  • 与官网一致:本页所有请求体、字段命名与返回结构与可灵官网保持一致
  • 字段详解:请参考官网权威文档
请求参数
参数类型必填说明
model_namestring模型名称,默认 kling-v1
imagestring*首帧图片 URL 或 Base64(与 image_tail 至少二选一)
image_tailstring尾帧图片 URL 或 Base64
promptstring文本提示词
negative_promptstring负向文本提示词
cfg_scalenumber生成自由度 [0, 1]
modestring生成模式:stdpro,默认 std
static_maskstring静态笔刷涂抹区域
dynamic_masksarray动态笔刷配置列表(最多6组)
camera_controlobject摄像机运动控制
aspect_ratiostring画面纵横比:16:99:161:1
durationstring视频时长:510
callback_urlstring回调通知地址
external_task_idstring自定义任务ID
重要约束image_taildynamic_masks/static_maskcamera_control 三组参数互斥,只能选择其中一种使用。
动态笔刷配置
{
  "dynamic_masks": [
    {
      "mask": "base64编码的掩码图片",
      "trajectories": [
        {"x": 100, "y": 200},
        {"x": 150, "y": 250}
      ]
    }
  ]
}
  • trajectories:运动轨迹坐标序列,以输入图片左下为原点的像素坐标,至少2个点,最多77个点

场景一:首帧驱动

curl --request POST \
  --url https://models.kapon.cloud/kling/v1/videos/image2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v1",
    "image": "https://example.com/first-frame.jpg",
    "prompt": "A mouse runs toward the camera, smiling and blinking",
    "mode": "std",
    "duration": "5",
    "aspect_ratio": "16:9"
  }'

场景二:首帧 + 尾帧

curl --request POST \
  --url https://models.kapon.cloud/kling/v1/videos/image2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v1",
    "image": "https://example.com/child.jpg",
    "image_tail": "https://example.com/adult.jpg",
    "prompt": "A little girl grows up",
    "mode": "pro",
    "duration": "10"
  }'

场景三:仅尾帧驱动

curl --request POST \
  --url https://models.kapon.cloud/kling/v1/videos/image2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v1",
    "image_tail": "https://example.com/ending-scene.jpg",
    "prompt": "Scene gradually transitions to the ending",
    "duration": "5"
  }'

场景四:使用摄像机运镜

curl --request POST \
  --url https://models.kapon.cloud/kling/v1/videos/image2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v2-master",
    "image": "https://example.com/landscape.jpg",
    "prompt": "Camera slowly zooms in on the mountain peak",
    "camera_control": {
      "type": "simple",
      "config": {
        "zoom": 5
      }
    },
    "duration": "10"
  }'
示例响应
{
  "code": 0,
  "message": "success",
  "request_id": "req_1735558800_xyz789",
  "data": {
    "task_id": "task_01JGHM...",
    "task_status": "submitted",
    "created_at": 1735558800000,
    "updated_at": 1735558800000
  }
}