> ## 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 POST /runwayml/v1/video_to_video를 사용해 비디오-투-비디오 생성 작업을 시작하고, X-Runway-Version을 설정하며, 소스 클립을 변환합니다.

이 엔드포인트를 사용하면 Runway의 비디오-투-비디오 워크플로로 기존 소스 클립을 변환할 수 있습니다. 최종 출력을 즉시 반환하는 대신 비동기 작업을 시작합니다.

## 호출하기 전에

* 제공업체의 입력 요구사항에 맞는 소스 비디오를 준비하세요
* 원하는 기능 세트에 필요한 `X-Runway-Version` 헤더를 포함하세요
* 전체 스토리보드가 아니라 변경 사항을 설명하는 짧은 프롬프트 하나로 시작하세요

## 출력 비율

| 설정      | 지원 값                                                             | 기본 시작점     | 경계 동작                 |
| ------- | ---------------------------------------------------------------- | ---------- | --------------------- |
| `ratio` | `1280:720`, `720:1280`, 또는 선택한 Runway model/version에서 허용하는 다른 비율 | `1280:720` | 가능하면 소스 클립의 방향에 맞추세요. |

이 엔드포인트는 콜론으로 구분된 `ratio` 값을 기대합니다. `1280x720` 출력에는 `1280:720`을, `720x1280`에는 `720:1280`을 사용하세요. `1280x720`은 모든 Runway 비디오-투-비디오 라우트에서 허용되지는 않습니다.

## 작업 흐름

<Steps>
  <Step title="소스 클립과 프롬프트 제출">
    이 엔드포인트에서 작업을 시작하고 반환된 작업 id를 저장하세요.
  </Step>

  <Step title="작업 세부정보 폴링">
    작업이 종료 상태에 도달할 때까지 [Runway 작업 가져오기](./runway-to-get-task-details)를 사용하세요.
  </Step>

  <Step title="변환된 결과 저장">
    일반적인 미디어 파이프라인을 통해 완료된 에셋을 다운로드하거나 저장하세요.
  </Step>
</Steps>


## OpenAPI

````yaml api/openapi/video/runway/official-format/post-generate-a-video-from-a-video.openapi.json POST /runwayml/v1/video_to_video
openapi: 3.1.0
info:
  title: Generate a video from a video API
  version: 1.0.0
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /runwayml/v1/video_to_video:
    post:
      summary: Generate a video from a video
      operationId: generate_a_video_from_a_video
      parameters:
        - name: X-Runway-Version
          in: header
          required: true
          description: Runway API version header, for example `2024-11-06`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - videoUri
                - promptText
                - seed
                - model
                - references
                - ratio
                - contentModeration
              properties:
                videoUri:
                  type: string
                  description: >-
                    HTTPS URL of the source video, or a base64 data URI
                    containing the video.
                  default: https://your-video-host/source.mp4
                promptText:
                  type: string
                  description: >-
                    Text prompt describing the desired output. Maximum 1000
                    characters.
                  default: A cat yawning in slow motion.
                seed:
                  type: integer
                  description: 'Random seed for reproducible results. Range: 0–4294967295.'
                  default: 1
                model:
                  type: string
                  description: Model variant to use.
                  default: gen4_aleph
                references:
                  type: array
                  description: >-
                    Optional reference images to guide generation. Each item
                    must include `type` (e.g. `image`) and `uri` (HTTPS URL).
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                      uri:
                        type: string
                  default:
                    - {}
                ratio:
                  type: string
                  description: >-
                    Requested output frame shape. Use colon-separated values
                    such as 1280:720 or 720:1280; read them as 1280x720 and
                    720x1280 targets. Do not assume every Runway video-to-video
                    route accepts 1280x720 with an x separator.
                  default: '1280:720'
                contentModeration:
                  type: object
                  required:
                    - publicFigureThreshold
                  properties:
                    publicFigureThreshold:
                      type: string
                      description: >-
                        Threshold for public-figure detection. Use `auto` for
                        default behavior.
                  default:
                    publicFigureThreshold: auto
              default:
                videoUri: https://media.w3.org/2010/05/sintel/trailer.mp4
                promptText: Make the motion feel cinematic.
                model: gen4_aleph
                references:
                  - type: image
                    uri: https://res.cloudinary.com/demo/image/upload/dog.jpg
                ratio: '1280:720'
            examples:
              Default:
                summary: Default
                value:
                  videoUri: https://media.w3.org/2010/05/sintel/trailer.mp4
                  promptText: Make the motion feel cinematic.
                  model: gen4_aleph
                  references:
                    - type: image
                      uri: https://res.cloudinary.com/demo/image/upload/dog.jpg
                  ratio: '1280:720'
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
                    description: >-
                      The ID of the task that was created. Use this to retrieve
                      the task later.
                example:
                  id: 12a01a5e-ab55-4aa7-b002-7b873546cf76
      x-codeSamples:
        - lang: Shell
          label: Default
          source: |
            curl https://api.cometapi.com/runwayml/v1/video_to_video \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                  "videoUri": "https://your-video-host/source.mp4",
                  "promptText": "Make the motion feel cinematic.",
                  "model": "gen4_aleph",
                  "references": [
                    {
                      "type": "image",
                      "uri": "https://your-image-host/style.jpg"
                    }
                  ]
                }'
        - lang: Python
          label: Default
          source: >
            import os

            import requests


            response = requests.post(
                "https://api.cometapi.com/runwayml/v1/video_to_video",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json={
                        "videoUri": "https://your-video-host/source.mp4",
                        "promptText": "Make the motion feel cinematic.",
                        "model": "gen4_aleph",
                        "references": [
                                {
                                        "type": "image",
                                        "uri": "https://your-image-host/style.jpg"
                                }
                        ]
                },
            )


            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/video_to_video", {
                method: "POST",
                headers: {
                    Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                    "Content-Type": "application/json",
                },
                body: JSON.stringify({
                        "videoUri": "https://your-video-host/source.mp4",
                        "promptText": "Make the motion feel cinematic.",
                        "model": "gen4_aleph",
                        "references": [
                            {
                                "type": "image",
                                "uri": "https://your-image-host/style.jpg"
                            }
                        ]
                    }),
            });


            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.

````