> ## 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/image2video를 통해 단일 이미지를 Kling 비디오로 변환하며, 비동기 작업 생성과 task ID 기반 진행 상황 추적을 지원합니다.

이 엔드포인트를 사용해 하나의 원본 이미지를 Kling 비디오로 애니메이션화할 수 있습니다.

## 호출 전에 확인할 사항

* 공개 이미지 URL 1개 또는 base64 이미지 문자열 1개를 제공하세요
* Kling 픽셀 요구사항을 충족하는 이미지를 사용하세요. 너무 작은 썸네일은 생성 작업에서 거부됩니다
* 기본 `kling-v2-6` 예제로 시작한 다음, 다른 모델 계열이 필요할 때 OpenAPI enum에서 다른 `model_name`을 선택하세요
* 첫 번째 요청은 단순하게 유지하세요: 입력 이미지 1개, 프롬프트(Prompt) 1개, tail frame 없음, motion mask 없음
* 제어된 국소 움직임이 필요할 때는 `dynamic_masks`를 mask-and-trajectory 객체의 배열로 사용하세요
* 생성된 사운드를 지원하는 모델 계열에서는 오디오 없이 결정적인 첫 요청을 위해 `sound: off`를 사용하세요

## 모델 이름 지정

이 엔드포인트에서는 일반 Kling 비디오 model ID를 사용하세요. Omni model ID는 [Omni Video](./omni-video)용으로 유지하세요.

## 작업 흐름

<Steps>
  <Step title="이미지-투-비디오 요청 제출">
    작업을 생성하고 반환된 Kling `task_id`를 저장하세요.
  </Step>

  <Step title="작업 폴링">
    출력이 준비될 때까지 [Kling 작업 가져오기](./individual-queries)를 통해 작업 상태를 계속 추적하세요.
  </Step>

  <Step title="결과 저장">
    제공자 전달 URL보다 오래 보관해야 한다면 완료된 자산을 저장하세요.
  </Step>
</Steps>

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


## OpenAPI

````yaml api/openapi/video/kling/post-image-to-video.openapi.json POST /kling/v1/videos/image2video
openapi: 3.1.0
info:
  title: Image to Video API
  version: 1.0.0
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /kling/v1/videos/image2video:
    post:
      summary: Create a Kling image-to-video task
      description: Submit one source image and receive a task id for later polling.
      operationId: image_to_video
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image
              properties:
                prompt:
                  type: string
                  description: >-
                    Text prompt describing the desired motion. Maximum 500
                    characters.
                negative_prompt:
                  type: string
                  description: Elements to exclude from the video. Maximum 200 characters.
                image:
                  type: string
                  description: >-
                    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.
                callback_url:
                  type: string
                  description: >-
                    Webhook URL to receive task status updates when the task
                    completes.
                mode:
                  type: string
                  description: >-
                    Generation mode. `std` for standard (faster), `pro` for
                    professional (higher quality).
                  enum:
                    - std
                    - pro
                  default: std
                model_name:
                  type: string
                  description: >-
                    Model ID for this image-to-video request. Use `kling-v3` for
                    new requests. Use Omni model IDs only with the Omni Video
                    endpoint.
                  enum:
                    - 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
                  default: kling-v1
                image_tail:
                  type: string
                  description: >-
                    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:
                  type: number
                  description: >-
                    Prompt adherence strength. Higher values follow the prompt
                    more closely. Range: 0–1.
                duration:
                  type: string
                  description: >-
                    Output video length in seconds. Use `5` or `10`; omit to use
                    `5`.
                  default: '5'
                static_mask:
                  type: string
                  description: >-
                    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:
                  type: array
                  description: >-
                    Optional motion masks. Each entry contains a mask image and
                    an ordered trajectory list.
                  items:
                    type: object
                    required:
                      - mask
                      - trajectories
                    properties:
                      mask:
                        type: string
                        description: Mask image URL or base64 string for the moving area.
                      trajectories:
                        type: array
                        description: Trajectory points for the masked area.
                        items:
                          type: object
                          required:
                            - x
                            - 'y'
                          properties:
                            x:
                              type: integer
                              description: Horizontal coordinate.
                            'y':
                              type: integer
                              description: Vertical coordinate.
                external_task_id:
                  type: string
                  description: >-
                    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:
                  type: string
                  description: >-
                    Optional generated-audio switch for models that support
                    video sound. Use `on` or `off`, or omit the field for the
                    model default.
                  enum:
                    - 'on'
                    - 'off'
              default:
                image: https://your-image-host/source.jpg
                prompt: A cinematic slow push-in on the subject
                model_name: kling-v3
                mode: pro
                duration: '5'
                sound: 'off'
            examples:
              Default:
                summary: Image-to-video request with generated sound disabled
                value:
                  image: https://your-image-host/source.jpg
                  prompt: A cinematic slow push-in on the subject
                  model_name: kling-v3
                  mode: pro
                  duration: '5'
                  sound: 'off'
      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: success
                  data:
                    task_id: '2032273942220931072'
                    task_status: submitted
                    task_info: {}
                    created_at: 1773366840306
                    updated_at: 1773366840306
      x-codeSamples:
        - lang: Shell
          label: Default
          source: |
            curl https://api.cometapi.com/kling/v1/videos/image2video \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                  "image": "https://your-image-host/source.jpg",
                  "prompt": "A cinematic slow push-in on the subject",
                  "model_name": "kling-v3",
                  "mode": "pro",
                  "duration": "5",
                  "sound": "off"
                }'
        - lang: Python
          label: Default
          source: |
            import os
            import requests

            response = requests.post(
                "https://api.cometapi.com/kling/v1/videos/image2video",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json={
                  "image": "https://your-image-host/source.jpg",
                  "prompt": "A cinematic slow push-in on the subject",
                  "model_name": "kling-v3",
                  "mode": "pro",
                  "duration": "5",
                  "sound": "off"
                },
            )

            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/image2video", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "image": "https://your-image-host/source.jpg",
                "prompt": "A cinematic slow push-in on the subject",
                "model_name": "kling-v3",
                "mode": "pro",
                "duration": "5",
                "sound": "off"
              }),
            });


            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.

````