Kling
Kling のマルチ画像動画タスクを作成する
CometAPI の POST /kling/v1/videos/multi-image2video を介して複数画像から Kling 動画を作成し、motion control と出力設定を使って生成できます。
POST
/
kling
/
v1
/
videos
/
multi-image2video
cURL
curl https://api.cometapi.com/kling/v1/videos/multi-image2video \
-H "Authorization: Bearer $COMETAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_list": [
{
"image": "https://your-image-host/first-frame.jpg"
},
{
"image": "https://your-image-host/second-frame.jpg"
}
],
"prompt": "A smooth transition between the two reference moments",
"mode": "std",
"duration": "5",
"aspect_ratio": "1:1"
}'import os
import requests
response = requests.post(
"https://api.cometapi.com/kling/v1/videos/multi-image2video",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json={
"image_list": [
{
"image": "https://your-image-host/first-frame.jpg"
},
{
"image": "https://your-image-host/second-frame.jpg"
}
],
"prompt": "A smooth transition between the two reference moments",
"mode": "std",
"duration": "5",
"aspect_ratio": "1:1"
},
)
result = response.json()
print(result.get("code"), result.get("data", {}).get("task_id"))
const response = await fetch("https://api.cometapi.com/kling/v1/videos/multi-image2video", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"image_list": [
{
"image": "https://your-image-host/first-frame.jpg"
},
{
"image": "https://your-image-host/second-frame.jpg"
}
],
"prompt": "A smooth transition between the two reference moments",
"mode": "std",
"duration": "5",
"aspect_ratio": "1:1"
}),
});
const result = await response.json();
console.log(result.code, result.data?.task_id);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/kling/v1/videos/multi-image2video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image_list' => [
[
'image' => 'https://your-image-host/first-frame.jpg'
],
[
'image' => 'https://your-image-host/second-frame.jpg'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/kling/v1/videos/multi-image2video"
payload := strings.NewReader("{\n \"image_list\": [\n {\n \"image\": \"https://your-image-host/first-frame.jpg\"\n },\n {\n \"image\": \"https://your-image-host/second-frame.jpg\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cometapi.com/kling/v1/videos/multi-image2video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image_list\": [\n {\n \"image\": \"https://your-image-host/first-frame.jpg\"\n },\n {\n \"image\": \"https://your-image-host/second-frame.jpg\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/kling/v1/videos/multi-image2video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image_list\": [\n {\n \"image\": \"https://your-image-host/first-frame.jpg\"\n },\n {\n \"image\": \"https://your-image-host/second-frame.jpg\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "SUCCEED",
"data": {
"task_id": "861309198188019719",
"task_status": "submitted",
"task_info": {},
"created_at": 1773380633979,
"updated_at": 1773380633979
}
}ソース画像が 1 枚では不十分で、複数の画像参照から Kling に動きを構築させたい場合は、このエンドポイントを使用します。
呼び出し前に
image_listに 1 ~ 4 枚の画像を用意します- Kling のピクセル要件を満たす画像を使用してください。小さすぎるサムネイルは生成タスクで拒否されます
- ルート互換モデルを明示的に選択する必要がある場合を除き、
model_nameは省略してください - 最初のテストはシンプルにしてください。短い prompt、
duration: 5、追加のコールバック設定なしで始めます - このルートでは、
static_maskやdynamic_masksなどの image-to-video マスクフィールドを送信しないでください
タスクの流れ
1
マルチ画像リクエストを送信する
画像リスト、prompt、duration を送信し、返された Kling の
task_id を保存します。2
タスクをポーリングする
タスクが終端状態に達するまで、Kling タスクを取得する を使って確認を続けます。
3
結果を保存する
プロバイダーの配信 URL を超えて保持する必要がある場合は、完成した動画を保存します。
完全なパラメータリファレンスについては、Kling 公式ドキュメント を参照してください。
ボディ
application/json
最終更新日 2026年6月26日
⌘I
cURL
curl https://api.cometapi.com/kling/v1/videos/multi-image2video \
-H "Authorization: Bearer $COMETAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_list": [
{
"image": "https://your-image-host/first-frame.jpg"
},
{
"image": "https://your-image-host/second-frame.jpg"
}
],
"prompt": "A smooth transition between the two reference moments",
"mode": "std",
"duration": "5",
"aspect_ratio": "1:1"
}'import os
import requests
response = requests.post(
"https://api.cometapi.com/kling/v1/videos/multi-image2video",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json={
"image_list": [
{
"image": "https://your-image-host/first-frame.jpg"
},
{
"image": "https://your-image-host/second-frame.jpg"
}
],
"prompt": "A smooth transition between the two reference moments",
"mode": "std",
"duration": "5",
"aspect_ratio": "1:1"
},
)
result = response.json()
print(result.get("code"), result.get("data", {}).get("task_id"))
const response = await fetch("https://api.cometapi.com/kling/v1/videos/multi-image2video", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"image_list": [
{
"image": "https://your-image-host/first-frame.jpg"
},
{
"image": "https://your-image-host/second-frame.jpg"
}
],
"prompt": "A smooth transition between the two reference moments",
"mode": "std",
"duration": "5",
"aspect_ratio": "1:1"
}),
});
const result = await response.json();
console.log(result.code, result.data?.task_id);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/kling/v1/videos/multi-image2video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image_list' => [
[
'image' => 'https://your-image-host/first-frame.jpg'
],
[
'image' => 'https://your-image-host/second-frame.jpg'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/kling/v1/videos/multi-image2video"
payload := strings.NewReader("{\n \"image_list\": [\n {\n \"image\": \"https://your-image-host/first-frame.jpg\"\n },\n {\n \"image\": \"https://your-image-host/second-frame.jpg\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cometapi.com/kling/v1/videos/multi-image2video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image_list\": [\n {\n \"image\": \"https://your-image-host/first-frame.jpg\"\n },\n {\n \"image\": \"https://your-image-host/second-frame.jpg\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/kling/v1/videos/multi-image2video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image_list\": [\n {\n \"image\": \"https://your-image-host/first-frame.jpg\"\n },\n {\n \"image\": \"https://your-image-host/second-frame.jpg\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "SUCCEED",
"data": {
"task_id": "861309198188019719",
"task_status": "submitted",
"task_info": {},
"created_at": 1773380633979,
"updated_at": 1773380633979
}
}