跳轉到主要內容
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