Kling Motion Control タスクを作成する
互換性のある CometAPI ルートを使用して、キャラクター画像と参照モーション動画から Kling Motion Control タスクを作成します。
必要なメディア
image_url は、パブリック URL または生の Base64 文字列を受け付けます。
- 10 MB 以下の JPG、JPEG、または PNG 画像を使用してください。
- 各画像の寸法は 300~65,536 ピクセルにしてください。
- アスペクト比は 1:2.5~2.5:1 にしてください。
- Base64 は、生のエンコード文字列として送信し、
data:image/...;base64,プレフィックスは含めないでください。 - モーション 参照と一致する全身構図で、遮蔽物のないキャラクターを 1 人表示してください。
video_url は、パブリックな MP4 または MOV の URL を受け付けます。
- 100 MB 以下の動画を使用してください。
- 短辺は少なくとも 340 ピクセルにしてください。
- 長辺は 3850 ピクセル以下にしてください。
- 表示されるキャラクターが 1 人の連続したショットを使用してください。
- カット、カメラ変更、過度に速い動きは避けてください。
task_status を確認してください。
外側の HTTP 200 またはレスポンスの code: 0 はクエリ応答を確認するものであり、
生成の成功結果を示すものではありません。orientation 値を設定する
character_orientation は必須であり、image または video を受け付けます。
element_list を使用する場合は、character_orientation を video に設定してください。
モデルとモードを選択する
互換性のあるルートはkling-v2-6 と kling-v3 を受け付けます。どちらのモデル値も
両方のモード値を受け付けます。
model_name を省略した場合、リクエストでは kling-v2-6 が使用されます。mode を省略した場合、
リクエストでは std が使用されます。kling-v3 値は、互換リクエストの形式を維持します。
このページで説明する形式であり、別の Kling 3.0 パスバージョン
契約を選択するものではありません。
互換契約では固定の出力解像度は保証されません。アプリケーションで特定の寸法が必要な場合は、
返された各動画を確認してください。
keep_original_sound は yes または no を受け付けます。このフィールドを省略した場合、
リクエストでは yes が使用されます。
タスクフロー
Motion Control リクエストを送信する
task_id を保存します。タスクをポーリングする
task_id とともに使用します。
ステータスが succeed または failed になるまで続けてください。結果を保存する
任意フィールド
コールバック構造
Legacy コールバック スキーマの構造は次のとおりです。submitted、processing、succeed、または failed を指定できます。
終端結果フィールドは、終端状態で返される場合にのみ存在します。
結果フィールド
submitted、processing、succeed、または failed です。
承認
Bearer authentication. Use your CometAPI API key.
ボディ
Character image as a public URL or a raw Base64 string. Send raw Base64 without a data:image/...;base64, prefix; data-URI input is outside the compatible contract. Supported formats are JPG, JPEG, and PNG. The image must be 10 MB or smaller. Its width and height must each be from 300 through 65,536 pixels, and its aspect ratio must be between 1:2.5 and 2.5:1.
Public reference motion video URL. Use an MP4 or MOV file that is 100 MB or smaller. The short edge must be at least 340 pixels, and the long edge must not exceed 3850 pixels. The video must be at least 3 seconds long. The maximum duration depends on character_orientation.
Required compatible string enum. With image, the reference video can be 3 to 10 seconds long. With video, the reference video can be 3 to 30 seconds long.
image, video Model ID for this compatible Motion Control request. Omit this field to use kling-v2-6. The kling-v3 value keeps this compatible request shape; it does not select the separate Kling 3.0 path-version contract.
kling-v2-6, kling-v3 Optional text field in the compatible request structure. Maximum 2500 characters.
2500Compatible string enum. Accepted values are yes and no. Omitted requests use yes.
yes, no Both compatible models accept std and pro. Omitted requests use std.
std, pro Optional callback field in the compatible structure. Provide a URI, or omit the field or send an empty string when no callback URI is configured.
Optional ID for correlation in your application. The value must be unique for your account. Store the returned task_id for CometAPI status queries.
Optional compatible Element structure. Provide at most one object, and combine this field only with character_orientation: video.
1Optional compatible watermark structure.