透過 CometAPI 建立 Kling 多模態影片編輯任務:POST /kling/v1/videos/multi-elements,以組合多個元素並非同步產生影片。
curl --request POST \
--url https://api.cometapi.com/kling/v1/videos/multi-elements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session_id": "784914037360041984",
"edit_mode": "replace",
"prompt": "Replace the selected object with a red paper boat."
}
'{
"code": 123,
"message": "<string>",
"data": {
"task_id": "<string>",
"task_status": "<string>",
"created_at": 123,
"updated_at": 123
}
}初始化編輯工作階段
session_id。建立選取區域
Bearer token authentication. Use your CometAPI key.
Session id returned by the video initialization endpoint.
Editing operation to apply. Options: replace, remove.
Text prompt describing the desired edit for the selected region.
curl --request POST \
--url https://api.cometapi.com/kling/v1/videos/multi-elements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session_id": "784914037360041984",
"edit_mode": "replace",
"prompt": "Replace the selected object with a red paper boat."
}
'{
"code": 123,
"message": "<string>",
"data": {
"task_id": "<string>",
"task_status": "<string>",
"created_at": 123,
"updated_at": 123
}
}