メインコンテンツへスキップ
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 はポイントを配置するフレームを選択します
  • points0 から 1 の正規化座標です
  • 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