跳转到主要内容
POST
/
kling
/
v1
/
videos
/
multi-elements
/
add-selection
Add selection points to a Kling multimodal session
curl --request POST \
  --url https://api.cometapi.com/kling/v1/videos/multi-elements/add-selection \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "session_id": "784914037360041984",
  "frame_index": 1,
  "points": [
    {
      "x": 0,
      "y": 1
    }
  ]
}
'
{
  "code": 123,
  "message": "<string>",
  "data": {}
}
使用此端点标记你希望多模态编辑器操作的视频区域。

选区的工作方式

  • session_id 来自初始化待编辑视频
  • frame_index 用于选择你放置点的帧
  • points 是介于 01 之间的归一化坐标
  • Kling 当前文档说明最多支持 10 个已标记帧,每帧最多支持 10 个点

在工作流中的作用

1

先初始化

先从初始化待编辑视频开始,以获取有效的 session_id
2

添加或细化点位

在你构建要编辑的区域时调用此端点。
3

预览区域

在最终提交前使用预览已选视频区域
如需完整的参数参考,请参阅 Kling API 文档

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

请求体

application/json
session_id
string
默认值:784914037360041984
必填

Session ID, generated based on the video initialization task, does not change with selection editing actions.

frame_index
integer
默认值:1
必填

Frame number

Supports adding up to 10 marked frames, meaning video selections can be marked based on a maximum of 10 frames. Only 1 frame can be marked at a time.

points
object[]
必填

Click coordinates, represented by x and y. Value range: [0,1], expressed as a percentage; [0,1] represents the top-left corner of the frame. Supports adding multiple marked points simultaneously, with a maximum of 10 points per frame.

响应

200 - application/json

Selection updated.

code
integer
必填
message
string
必填
data
object