> ## 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 Control a character API를 사용해 참조 비디오로부터 캐릭터 퍼포먼스 작업을 시작하고, 표정과 신체 움직임을 제어합니다.

이 엔드포인트를 사용하면 참조 클립의 퍼포먼스를 캐릭터 이미지 또는 캐릭터 비디오에 전이할 수 있습니다.

## 호출 전에 확인할 사항

* 필수 `X-Runway-Version` 헤더를 전송하세요. 예: `2024-11-06`
* `model: act_two`를 사용하세요
* 접근 가능한 HTTPS URL로 `character` asset 1개와 `reference` asset 1개를 제공하세요
* 스타일을 조정하기 전에 `bodyControl: true`와 중간 정도의 `expressionIntensity`로 시작하세요

## 출력 비율

| 설정      | 지원 값                                                            | 기본 시작점     | 경계 동작                                      |
| ------- | --------------------------------------------------------------- | ---------- | ------------------------------------------ |
| `ratio` | `1280:720`, `720:1280`, 또는 선택한 Runway model/version이 허용하는 다른 비율 | `1280:720` | 캐릭터와 참조 asset이 요청한 프레임 형태와 최대한 가깝도록 유지하세요. |

## 작업 흐름

<Steps>
  <Step title="캐릭터 퍼포먼스 요청 제출">
    캐릭터 asset, 참조 asset, 모션 설정으로 작업을 생성합니다.
  </Step>

  <Step title="반환된 task id 저장">
    이후 폴링에 필요하므로 반환된 `id`를 보관하세요.
  </Step>

  <Step title="작업 상태 폴링">
    작업이 최종 상태에 도달하고 provider 메타데이터에 완료된 출력이 포함될 때까지 [Runway 작업 가져오기](./runway-to-get-task-details)를 계속 진행하세요.
  </Step>
</Steps>

## 입력 역할

* `character`는 애니메이션을 적용할 대상입니다
* `reference`는 표정 퍼포먼스 또는 신체 움직임을 제공하는 소스 클립입니다
* `bodyControl`은 모션 전이가 표정 전이와 함께 신체 움직임까지 포함할지 결정합니다
* `contentModeration`은 요청에 provider의 moderation 임계값을 적용합니다


## OpenAPI

````yaml api/openapi/video/runway/official-format/post-control-a-character.openapi.json POST /runwayml/v1/character_performance
openapi: 3.1.0
info:
  title: Control a Character API
  version: 1.0.0
  description: >-
    Create a Runway character-performance task through the official-format
    CometAPI route.
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /runwayml/v1/character_performance:
    post:
      summary: Create a Runway character-performance task
      description: >-
        Submit a character asset plus a reference performance clip and receive a
        task id for later polling.
      operationId: control_a_character
      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:
                - character
                - reference
                - bodyControl
                - expressionIntensity
                - seed
                - model
                - ratio
                - contentModeration
              properties:
                character:
                  type: object
                  description: >-
                    The character to control. You can either provide a video or
                    an image.
                  required:
                    - type
                    - uri
                  properties:
                    type:
                      type: string
                    uri:
                      type: string
                  default:
                    type: video
                    uri: https://your-video-host/source.mp4
                reference:
                  type: object
                  description: >-
                    Reference performance clip. Provide `type` (`video`) and
                    `uri` (HTTPS URL).
                  required:
                    - type
                    - uri
                  properties:
                    type:
                      type: string
                    uri:
                      type: string
                  default:
                    type: video
                    uri: https://your-video-host/source.mp4
                bodyControl:
                  type: boolean
                  description: Enable body control.
                  default: true
                expressionIntensity:
                  type: integer
                  description: >-
                    Intensity of the expression transfer. Higher values produce
                    more exaggerated expressions.
                  default: 1
                seed:
                  type: integer
                  description: Random seed for reproducible results.
                  default: 1
                model:
                  type: string
                  description: The model variant to use. Must be act_two.
                  default: act_two
                ratio:
                  type: string
                  description: >-
                    Requested output frame shape, for example 1280:720 or
                    720:1280. Keep the character and reference assets close to
                    the requested frame shape.
                  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:
                character:
                  type: video
                  uri: https://your-video-host/source.mp4
                reference:
                  type: video
                  uri: https://your-video-host/source.mp4
                bodyControl: true
                expressionIntensity: 1
                seed: 1
                model: act_two
                ratio: '1280:720'
                contentModeration:
                  publicFigureThreshold: auto
            examples:
              Default:
                summary: Default
                value:
                  character:
                    type: video
                    uri: https://your-video-host/source.mp4
                  reference:
                    type: video
                    uri: https://your-video-host/source.mp4
                  bodyControl: true
                  expressionIntensity: 3
                  seed: 4294967295
                  model: act_two
                  ratio: '1280:720'
                  contentModeration:
                    publicFigureThreshold: auto
      responses:
        '200':
          description: Task accepted.
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
                example:
                  id: 5b91e444-c232-deaf-a4d7-8aef3e57336b
      x-codeSamples:
        - lang: Shell
          label: Default
          source: |
            curl https://api.cometapi.com/runwayml/v1/character_performance \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                  "character": {
                    "type": "video",
                    "uri": "https://your-video-host/character.mp4"
                  },
                  "reference": {
                    "type": "video",
                    "uri": "https://your-video-host/performance.mp4"
                  },
                  "model": "act_two",
                  "ratio": "1280:720"
                }'
        - lang: Python
          label: Default
          source: >
            import os

            import requests


            response = requests.post(
                "https://api.cometapi.com/runwayml/v1/character_performance",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json={
                        "character": {
                                "type": "video",
                                "uri": "https://your-video-host/character.mp4"
                        },
                        "reference": {
                                "type": "video",
                                "uri": "https://your-video-host/performance.mp4"
                        },
                        "model": "act_two",
                        "ratio": "1280:720"
                },
            )


            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/character_performance",
            {
                method: "POST",
                headers: {
                    Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                    "Content-Type": "application/json",
                },
                body: JSON.stringify({
                        "character": {
                            "type": "video",
                            "uri": "https://your-video-host/character.mp4"
                        },
                        "reference": {
                            "type": "video",
                            "uri": "https://your-video-host/performance.mp4"
                        },
                        "model": "act_two",
                        "ratio": "1280:720"
                    }),
            });


            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.

````