Skip to main content
POST
cURL
このエンドポイントを使用すると、1 枚の元画像をアニメーション化して Kling 動画にできます。

呼び出す前に

  • 公開された画像 URL を 1 つ、または base64 画像文字列を 1 つ指定します
  • Kling のピクセル要件を満たす画像を使用してください。極端に小さいサムネイルは生成タスクで拒否されます
  • まずはデフォルトの kling-v2-6 の例から始め、別のモデル系統が必要な場合は OpenAPI の enum から別の model_name を選択してください
  • 最初のリクエストはシンプルにしてください: 入力画像 1 枚、プロンプト 1 つ、末尾フレームなし、motion masks なし
  • 局所的な動きを制御したい場合は、dynamic_masks を mask-and-trajectory オブジェクトの配列として使用します
  • 生成音声をサポートするモデル系統で、音声なしの決定的な初回リクエストにしたい場合は sound: off を使用します

モデル命名

このエンドポイントでは通常の Kling 動画 model ID を使用します。Omni model ID は Omni Video 用にしてください。

タスクの流れ

1

image-to-video リクエストを送信する

タスクを作成し、返された Kling の task_id を保存します。
2

タスクをポーリングする

出力の準備が整うまで、Kling タスクを取得する に進んでタスクステータスを追跡します。
3

結果を保存する

プロバイダーの配信 URL を超えて保持する必要がある場合は、完成したアセットを保存します。
完全なパラメータリファレンスについては、Kling 公式ドキュメント を参照してください。

承認

Authorization
string
header
必須

Bearer token authentication. Use your CometAPI key.

ボディ

application/json
image
string
必須

Source image URL or base64 image string. Use an image that meets Kling pixel requirements; very small thumbnails are rejected. For base64 input, send the encoded image string as the field value.

prompt
string

Text prompt describing the desired motion. Maximum 500 characters.

negative_prompt
string

Elements to exclude from the video. Maximum 200 characters.

callback_url
string

Webhook URL to receive task status updates when the task completes.

mode
enum<string>
デフォルト:std

Generation mode. std for standard (faster), pro for professional (higher quality).

利用可能なオプション:
std,
pro
model_name
enum<string>
デフォルト:kling-v1

Model ID for this image-to-video request. Use kling-v3 for new requests. Use Omni model IDs only with the Omni Video endpoint.

利用可能なオプション:
kling-v1,
kling-v1-5,
kling-v1-6,
kling-v2-master,
kling-v2-1,
kling-v2-1-master,
kling-v2-5-turbo,
kling-v2-6,
kling-v3
image_tail
string

Tail-frame reference image as a Base64 string or public URL. Same format requirements as image. Controls the last frame of the generated video.

cfg_scale
number

Prompt adherence strength. Higher values follow the prompt more closely. Range: 0–1.

duration
string
デフォルト:5

Output video length in seconds. Use 5 or 10; omit to use 5.

static_mask
string

Static brush mask image as a Base64 string or public URL. White areas are frozen in place during video generation. Must match the aspect ratio and resolution of the input image.

dynamic_masks
object[]

Optional motion masks. Each entry contains a mask image and an ordered trajectory list.

external_task_id
string

Custom task id for your own tracking. Does not replace the system-generated task id but can be used to query tasks. Must be unique per user.

sound
enum<string>

Optional generated-audio switch for models that support video sound. Use on or off, or omit the field for the model default.

利用可能なオプション:
on,
off

レスポンス

200 - application/json

Task accepted.

code
integer
必須

Error code; specifically define the error code

message
string
必須

error message

data
object
必須