> ## 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.

# Runway 이미지-투-비디오 작업 생성

> CometAPI를 사용해 Runway image_to_video를 호출하고 정지 이미지 URL을 raw 비디오 출력으로 변환하며, 호환성을 위한 X-Runway-Version을 지원합니다.

이 엔드포인트를 사용하면 하나의 소스 이미지를 애니메이션 처리하여 Runway 비디오로 만들 수 있습니다.

## 호출 전 확인 사항

* 필수 `X-Runway-Version` 헤더를 전송하세요. 예: `2024-11-06`
* `model: gen3a_turbo`를 사용하세요
* 안정적인 HTTPS `promptImage`를 제공하세요
* `duration: 5`와 선택한 Runway model/version에서 지원되는 ratio 값으로 시작하세요

## Duration 및 ratio

| 설정                                          | 지원 값                                                                                 | 기본 시작값               | 경계 동작                                                                   |
| ------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------- | ----------------------------------------------------------------------- |
| `duration`                                  | Runway model/version에 따라 다름. 가장 폭넓은 호환성을 위해 `5` 또는 `10` 사용                           | `5`                  | CometAPI는 이 값을 Runway로 전달합니다. 선택한 model/version이 이를 거부하면 `5`로 다시 시도하세요. |
| `ratio` with `X-Runway-Version: 2024-11-06` | `1280:768`, `768:1280`, `1280:720`, `720:1280`와 같은 Runway model/version 종속 해상도 스타일 값 | `1280:768`           | 완료된 미디어에서 요청 값이 정규화될 수 있으므로, 정확한 픽셀 값에 의존하기 전에 완성된 비디오를 확인하세요.          |
| `ratio` with older compatibility versions   | `16:9`, `9:16`, 또는 선택한 model/version에서 허용되는 해상도 스타일 값                                | `16:9` 또는 `1280:768` | 프로덕션 통합에서는 현재 Runway 해상도 스타일 값을 우선적으로 사용하세요.                            |

Runway 공식 형식 요청은 `size`가 아니라 `ratio`를 사용합니다. 해상도 스타일 ratio 값은 해당 `WxH` 값으로 이해하세요. `1280:720`은 `1280x720`을, `720:1280`은 `720x1280`을 의미하며, `1280:768`도 선택한 model/version에 따라 여전히 `1280x720`으로 렌더링될 수 있습니다.

## 작업 흐름

<Steps>
  <Step title="이미지-투-비디오 요청 제출">
    소스 이미지와 선택 사항인 짧은 모션 프롬프트(Prompt)로 작업을 생성합니다.
  </Step>

  <Step title="반환된 id 저장">
    나중에 폴링할 수 있도록 작업 `id`를 저장합니다.
  </Step>

  <Step title="작업 상태 폴링">
    [Runway 작업 가져오기](./runway-to-get-task-details)를 사용하세요. 첫 번째 폴링에서 `task_not_exist`가 반환되면 몇 초 기다린 뒤 다시 시도하세요.
  </Step>
</Steps>


## OpenAPI

````yaml api/openapi/video/runway/official-format/post-runway-images-raw-video.openapi.json POST /runwayml/v1/image_to_video
openapi: 3.1.0
info:
  title: Image to Video API
  version: 1.0.0
  description: >-
    Create a Runway image-to-video task through the official-format CometAPI
    route.
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /runwayml/v1/image_to_video:
    post:
      summary: Create a Runway image-to-video task
      description: >-
        Submit a source image plus optional motion prompt and receive a task id
        for later polling.
      operationId: runway_images_raw_video
      parameters:
        - name: X-Runway-Version
          in: header
          required: true
          description: Runway version header, for example `2024-11-06`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - promptImage
                - model
              properties:
                promptImage:
                  type: string
                  description: Source image URL.
                  default: >-
                    https://cdn.britannica.com/70/234870-050-D4D024BB/Orange-colored-cat-yawns-displaying-teeth.jpg
                seed:
                  type: integer
                  description: 'Random seed for reproducible results. Range: 0–999999999.'
                model:
                  type: string
                  description: >-
                    Runway image-to-video model ID. Choose an available model
                    from the [Models page](/overview/models).
                  default: gen3a_turbo
                promptText:
                  type: string
                  description: >-
                    Text prompt describing the desired motion or scene. Maximum
                    512 characters.
                watermark:
                  type: boolean
                  description: Whether to add a watermark to the output video.
                  default: false
                duration:
                  type: integer
                  description: >-
                    Video duration in seconds. Runway support is model/version
                    dependent; use 5 or 10 for the broadest compatibility.
                    CometAPI forwards this value to Runway.
                  default: 5
                ratio:
                  type: string
                  description: >-
                    Requested output ratio. Accepted values are Runway
                    model/version dependent. With X-Runway-Version 2024-11-06,
                    use a resolution-style value accepted by the selected model,
                    such as 1280:768, 768:1280, 1280:720, or 720:1280. Read
                    these as WxH targets, but completed media may normalize, so
                    inspect the returned file before relying on exact pixels.
                  default: '1280:768'
              default:
                promptImage: >-
                  https://cdn.britannica.com/70/234870-050-D4D024BB/Orange-colored-cat-yawns-displaying-teeth.jpg
                seed: 1
                model: gen3a_turbo
                promptText: A calm camera move.
                watermark: false
                duration: 5
                ratio: '1280:768'
            examples:
              Default:
                summary: Default
                value:
                  promptImage: >-
                    https://cdn.britannica.com/70/234870-050-D4D024BB/Orange-colored-cat-yawns-displaying-teeth.jpg
                  seed: 1
                  model: gen3a_turbo
                  promptText: A calm camera move.
                  watermark: false
                  duration: 5
                  ratio: '1280:768'
      responses:
        '200':
          description: Task accepted.
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
                example:
                  id: d0658ae1-bbdd-4adc-aaba-fd8070e14d79
      x-codeSamples:
        - lang: Shell
          label: Default
          source: |
            curl https://api.cometapi.com/runwayml/v1/image_to_video \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                  "promptImage": "https://your-image-host/first-frame.png",
                  "promptText": "A calm camera move.",
                  "model": "gen3a_turbo",
                  "ratio": "1280:768",
                  "duration": 5
                }'
        - lang: Python
          label: Default
          source: >
            import os

            import requests


            response = requests.post(
                "https://api.cometapi.com/runwayml/v1/image_to_video",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json={
                        "promptImage": "https://your-image-host/first-frame.png",
                        "promptText": "A calm camera move.",
                        "model": "gen3a_turbo",
                        "ratio": "1280:768",
                        "duration": 5
                },
            )


            task = response.json()

            print(task["id"])  # poll GET /runwayml/v1/tasks/{id} until the
            output array appears
        - lang: JavaScript
          label: Default
          source: >
            const response = await
            fetch("https://api.cometapi.com/runwayml/v1/image_to_video", {
                method: "POST",
                headers: {
                    Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                    "Content-Type": "application/json",
                },
                body: JSON.stringify({
                        "promptImage": "https://your-image-host/first-frame.png",
                        "promptText": "A calm camera move.",
                        "model": "gen3a_turbo",
                        "ratio": "1280:768",
                        "duration": 5
                    }),
            });


            const task = await response.json();

            console.log(task.id); // poll GET /runwayml/v1/tasks/{id} until the
            output array appears
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication. Use your CometAPI key.

````