Skip to main content
POST
cURL
使用此端點在您的工作階段與選擇都準備完成後,提交最終的多模態影片編輯作業。

完整流程

1

初始化編輯工作階段

先從 初始化待編輯影片 開始,以取得您要編輯片段的 session_id
2

建立選取區域

使用 新增影片選取範圍,並在需要時使用 預覽已選取的影片區域 來微調編輯區域。
3

提交最終任務

透過此端點傳送 session_idedit_mode、最終 prompt,以及任何可選的產生設定,然後儲存回傳的 task id 以供狀態查詢。

呼叫前請先確認

  • 確保選取工作階段已完成初始化
  • 在耗用一次產生呼叫之前,確認您的區域選取正確無誤
  • 在同一個帳戶下,並使用初始化時回傳的確切 session_id,執行選取後續呼叫
  • edit_mode 設為 additionswapremoval
  • additionswap 需提供 image_listremoval 則省略 image_list
  • duration 以字串傳送,例如 "5""10";範例會明確傳入 "5"
  • 將此路由視為最終產生步驟,而不是設定步驟
  • 僅在編輯流程需要時才加入 image_listnegative_promptmodedurationcallback_urlexternal_task_id
如需完整參數參考,請參閱 Kling API 文件

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

主體

application/json
session_id
string
必填

Selection session id returned by init-selection. Follow-up calls must use the same account and exact session id.

edit_mode
enum<string>
必填

Editing operation for the selected video region. Use addition to add an element, swap to replace a selected element, or removal to remove it.

可用選項:
addition,
swap,
removal
prompt
string
必填

Instruction describing the desired edit. Reference the source video as <<<video_1>>> and any reference image as <<<image_1>>>.

model_name
enum<string>
預設值:kling-v1-6

Kling model variant for the final edit task. Omit to use kling-v1-6.

可用選項:
kling-v1-6
image_list
object[]

Image references used by addition and swap tasks. Omit this field for removal tasks.

Minimum array length: 1
negative_prompt
string

Elements to avoid in the edited result.

mode
enum<string>

Generation mode. Use std or pro.

可用選項:
std,
pro
duration
string

Requested output duration in seconds.

callback_url
string

Webhook URL to receive task status updates.

external_task_id
string

Custom task id for your own tracking. Must be unique per account.

回應

200 - application/json

Task accepted.

code
integer
必填
message
string
必填
data
object
必填