Tạo một tác vụ chỉnh sửa đa phương thức của Kling
Tạo một tác vụ chỉnh sửa video đa phương thức của Kling thông qua CometAPI: POST /kling/v1/videos/multi-elements để kết hợp nhiều phần tử và tạo video bất đồng bộ.
Quy trình đầy đủ
Khởi tạo phiên chỉnh sửa
session_id cho clip bạn muốn chỉnh sửa.Xây dựng vùng lựa chọn
Gửi tác vụ cuối cùng
session_id, edit_mode, prompt cuối cùng và mọi cài đặt tạo tùy chọn thông qua endpoint này, sau đó lưu task id được trả về để kiểm tra trạng thái.Trước khi gọi endpoint này
- Đảm bảo phiên lựa chọn đã được khởi tạo
- Xác nhận vùng bạn chọn là chính xác trước khi dùng một lượt gọi tạo
- Chạy các lệnh gọi tiếp theo cho vùng chọn trên cùng một tài khoản và với đúng
session_idđược trả về từ bước khởi tạo - Đặt
edit_modethànhaddition,swaphoặcremoval - Cung cấp
image_listchoadditionvàswap; bỏimage_listchoremoval - Gửi
durationdưới dạng chuỗi như"5"hoặc"10"; các ví dụ truyền"5"một cách rõ ràng - Coi route này là bước tạo cuối cùng, không phải bước thiết lập
- Chỉ thêm
image_list,negative_prompt,mode,duration,callback_urlhoặcexternal_task_idkhi quy trình chỉnh sửa cần đến chúng
Ủy quyền
Bearer token authentication. Use your CometAPI key.
Nội dung
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.