Create a Kling multimodal edit task
Create a Kling multimodal video editing task via CometAPI: POST /kling/v1/videos/multi-elements to combine multiple elements and generate videos asynchronously.
Full workflow
Initialize the editing session
session_id for the clip you want to edit.Build the selection area
Before you call it
- Make sure the selection session is already initialized
- Confirm your region selection is correct before spending a generation call
- Run selection follow-up calls on the same account and with the exact
session_idreturned by initialization - Set
edit_modetoaddition,swap, orremoval - Provide
image_listforadditionandswap; omitimage_listforremoval - Send
durationas a string such as"5"or"10"; examples pass"5"explicitly - Treat this route as the final generation step, not the setup step
- Add
image_list,negative_prompt,mode,duration,callback_url, orexternal_task_idonly when the edit workflow needs them
Authorizations
Bearer token authentication. Use your CometAPI key.
Body
Selection session id returned by init-selection. Follow-up calls must use the same account and exact session id.
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 Instruction describing the desired edit. Reference the source video as <<<video_1>>> and any reference image as <<<image_1>>>.
Kling model variant for the final edit task. Omit to use kling-v1-6.
kling-v1-6 Image references used by addition and swap tasks. Omit this field for removal tasks.
1Elements to avoid in the edited result.
Generation mode. Use std or pro.
std, pro Requested output duration in seconds.
Webhook URL to receive task status updates.
Custom task id for your own tracking. Must be unique per account.