メインコンテンツへスキップ
POST
/
kling
/
v1
/
images
/
generations
Multi-Image to Image
curl --request POST \
  --url https://api.cometapi.com/kling/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "subject_image_list": [
    {
      "subject_image": "https://filesystem.site/cdn/20250814/goDW44JIf6eSuxAS7TNringhWjO9kW.png"
    },
    {
      "subject_image": "https://filesystem.site/cdn/20250814/goDW44JIf6eSuxAS7TNringhWjO9kW.png"
    },
    {
      "subject_image": "https://filesystem.site/cdn/20250814/goDW44JIf6eSuxAS7TNringhWjO9kW.png"
    },
    {
      "subject_image": "https://filesystem.site/cdn/20250814/goDW44JIf6eSuxAS7TNringhWjO9kW.png"
    }
  ]
}
'
{
  "code": 123,
  "message": "<string>",
  "request_id": "<string>",
  "data": {
    "task_id": "<string>",
    "task_status": "<string>",
    "created_at": 123,
    "updated_at": 123
  }
}
複数の被写体参照画像に、任意でシーンまたはスタイル参照を加えて、Kling に1枚の画像を生成させたい場合は、このエンドポイントを使用します。

呼び出す前に

  • subject_image_list に 2〜4 枚の画像を指定します
  • model_name: kling-v2 を使用します
  • scence_image または style_image は、コアとなる被写体構成がすでにうまく機能している場合にのみ追加します
  • これは非同期の生成ルートとして扱い、返された task id を保存します

タスクフロー

1

画像生成タスクを送信

被写体画像リストとプロンプトを送信し、返された task id を保存します。
2

タスクをポーリング

タスクが終了状態に達するまで、Kling の画像クエリパスを使って 個別クエリ を継続します。
3

結果を保存

永続的にアクセスする必要がある場合は、生成された画像を自分のストレージに保存します。
完全なパラメータリファレンスについては、Kling の公式ドキュメント を参照してください。

承認

Authorization
string
header
必須

Bearer token authentication. Use your CometAPI key.

ヘッダー

Content-Type
string

Content type of the request body.

ボディ

application/json

Kling Image Generation API request body definition

subject_image_list
object[]
必須

List of subject reference images. Minimum 2, maximum 4.

model_name
enum<string>
デフォルト:kling-v2

Model to use for multi-image generation.

利用可能なオプション:
kling-v2
prompt
string

Text prompt describing the desired output. Max 2500 characters.

scence_image
string

Optional scene reference image. Same format and size constraints as subject images.

style_image
string

Optional style reference image. Same format and size constraints as subject images.

n
integer
デフォルト:1

Number of images to generate.

aspect_ratio
enum<string>
デフォルト:16:9

Aspect ratio of the generated image (width:height).

利用可能なオプション:
16:9,
9:16,
1:1,
4:3,
3:4,
3:2,
2:3,
21:9
callback_url
string

Webhook URL for task status notifications. The server sends a callback when the task status changes.

external_task_id
string

Optional user-defined task ID for your own tracking. Does not replace the system-generated task ID. Must be unique per account.

レスポンス

200 - application/json

Successful Response

code
integer

Error code; specifically define the error code

message
string

error message

request_id
string

Request ID, system-generated, for tracking requests, troubleshooting issues

data
object