Kling マルチモーダル編集タスクを作成する
CometAPI 経由で Kling のマルチモーダル動画編集タスクを作成します: POST /kling/v1/videos/multi-elements を使用して複数の要素を組み合わせ、非同期で動画を生成します。
完全なワークフロー
編集セッションを初期化する
session_id を取得するには、まず 動画編集の初期化 を行います。選択領域を作成する
最終タスクを送信する
session_id、edit_mode、最終的な prompt、および必要に応じた生成設定を送信し、返されたタスク id をステータス確認用に保存します。呼び出し前の確認事項
- 選択セッションがすでに初期化されていることを確認してください
- 生成呼び出しを消費する前に、領域選択が正しいことを確認してください
- 選択後の関連呼び出しは、初期化で返された正確な
session_idを使用し、同じアカウントで実行してください edit_modeをaddition、swap、またはremovalに設定してくださいadditionおよびswapではimage_listを指定し、removalではimage_listを省略してくださいdurationは"5"や"10"のような文字列で送信してください。例では明示的に"5"を渡しています- このルートはセットアップ手順ではなく、最終的な生成ステップとして扱ってください
image_list、negative_prompt、mode、duration、callback_url、またはexternal_task_idは、編集ワークフローで必要な場合にのみ追加してください
承認
Bearer token authentication. Use your CometAPI key.
ボディ
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.