> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kling 멀티 이미지 비디오 작업 생성

> CometAPI POST /kling/v1/videos/multi-image2video를 통해 여러 이미지로 Kling 비디오를 생성하며, 생성용 motion control 및 출력 설정을 지원합니다.

소스 이미지 하나만으로는 충분하지 않고 여러 이미지 참조를 바탕으로 Kling이 움직임을 구성하도록 하려는 경우 이 엔드포인트를 사용하세요.

## 호출 전에 확인할 것

* `image_list`에 1\~4개의 이미지를 준비하세요
* Kling의 픽셀 요구사항을 충족하는 이미지를 사용하세요. 너무 작은 썸네일은 생성 작업에서 거부됩니다
* 특정한 이유로 route-compatible model을 선택해야 하는 경우가 아니라면 `model_name`은 생략하세요
* 첫 테스트는 간단하게 유지하세요: 짧은 프롬프트(Prompt), `duration: 5`, 추가 callback 설정 없음
* 이 경로에서는 `static_mask`나 `dynamic_masks` 같은 image-to-video mask 필드를 보내지 마세요

## 작업 흐름

<Steps>
  <Step title="멀티 이미지 요청 제출">
    이미지 목록, 프롬프트(Prompt), duration을 전송한 다음 반환된 Kling `task_id`를 저장하세요.
  </Step>

  <Step title="작업 폴링">
    작업이 종료 상태에 도달할 때까지 [Kling 작업 조회](./individual-queries)를 계속 진행하세요.
  </Step>

  <Step title="결과 저장">
    제공업체 전달 URL보다 더 오래 보관해야 한다면 완료된 비디오를 저장하세요.
  </Step>
</Steps>

<Tip>
  전체 파라미터 참조는 [Kling 공식 문서](https://kling.ai/document-api/apiReference/model/multiImageToVideo)를 확인하세요.
</Tip>


## OpenAPI

````yaml api/openapi/video/kling/post-multi-image-to-video.openapi.json POST /kling/v1/videos/multi-image2video
openapi: 3.1.0
info:
  title: Multi-Image to Video API
  version: 1.0.0
  description: Create a Kling video task from multiple source images.
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /kling/v1/videos/multi-image2video:
    post:
      summary: Create a Kling multi-image-to-video task
      description: >-
        Submit 2 to 4 images plus a motion prompt and receive a task id for
        later polling.
      operationId: multi_image_to_video
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image_list
              properties:
                model_name:
                  type: string
                  description: >-
                    Kling model variant for multi-image video. Omit to use
                    `kling-v1-6`.
                  default: kling-v1-6
                  enum:
                    - kling-v1-6
                image_list:
                  type: array
                  description: >-
                    Input image references. Provide 1 to 4 items that meet Kling
                    pixel requirements; very small thumbnails are rejected.
                  minItems: 1
                  maxItems: 4
                  items:
                    type: object
                    required:
                      - image
                    properties:
                      image:
                        type: string
                        description: Image URL or base64 image string.
                prompt:
                  type: string
                  description: Text prompt describing the desired motion and scene.
                negative_prompt:
                  type: string
                  description: Elements to avoid in the generated video.
                mode:
                  type: string
                  description: >-
                    Generation mode. Use `std` or `pro`; omitted requests use
                    `std`.
                  enum:
                    - std
                    - pro
                  default: std
                duration:
                  type: string
                  description: >-
                    Output video length in seconds. Use `5` or `10`; omitted
                    requests use `5`.
                  default: '5'
                aspect_ratio:
                  type: string
                  description: >-
                    Requested frame aspect ratio when the model needs an
                    explicit frame shape.
                  enum:
                    - '16:9'
                    - '9:16'
                    - '1:1'
                callback_url:
                  type: string
                  description: Webhook URL to receive task status updates.
                external_task_id:
                  type: string
                  description: >-
                    Custom task id for your own tracking. Must be unique per
                    account.
              default:
                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'
            examples:
              Default:
                summary: Multi-image video request
                value:
                  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'
      responses:
        '200':
          description: Task accepted.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - data
                properties:
                  code:
                    type: integer
                    description: Error code; specifically define the error code
                  message:
                    type: string
                    description: error message
                  data:
                    type: object
                    required:
                      - task_id
                      - task_status
                      - created_at
                      - updated_at
                    properties:
                      task_id:
                        type: string
                        description: Task ID, system generated
                      task_status:
                        type: string
                        description: >-
                          Task status, enumerated values: submitted, processing,
                          succeed, failed.
                      task_status_msg:
                        type: string
                      task_info:
                        type: object
                        additionalProperties: true
                      created_at:
                        type: integer
                        description: Task creation time, Unix timestamp, in ms.
                      updated_at:
                        type: integer
                        description: Task update time, Unix timestamp, in ms.
                example:
                  code: 0
                  message: SUCCEED
                  data:
                    task_id: '861309198188019719'
                    task_status: submitted
                    task_info: {}
                    created_at: 1773380633979
                    updated_at: 1773380633979
      x-codeSamples:
        - lang: Shell
          label: Default
          source: |
            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"
                }'
        - lang: Python
          label: Default
          source: |
            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"))
        - lang: JavaScript
          label: Default
          source: >
            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);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication. Use your CometAPI key.

````