> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-chore-sync-comfy-api-v2-spec.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Comfy Router로 LTX 2.5 Pro 사용하기

> Comfy Router를 통해 ltx/ltx-2-5-pro를 호출하세요: endpoint, 요청 형태, 그리고 Router가 반환하는 응답입니다.

LTX에서 제공하고 Comfy Router가 서비스하는 `ltx/ltx-2-5-pro`의 API 레퍼런스입니다.

## 빠른 시작

[Comfy 워크스페이스](https://platform.comfy.org/profile/api-keys)에서 키를 생성하고 `COMFY_API_KEY`로 내보내세요. Python과 TypeScript 스니펫은 Comfy SDK(`pip install comfy-sdk`, `npm install @comfyorg/sdk`)를 사용하며, cURL 스니펫은 동일한 호출을 원시 HTTP로 수행합니다.

**모델 ID:** `ltx/ltx-2-5-pro`

**엔드포인트:** `POST https://api.comfy.org/v2/models/ltx/ltx-2-5-pro`

<Tabs>
  <Tab title="결과를 기다리기">
    <CodeGroup>
      ```python Python theme={null}
      from comfy_sdk import Comfy

      # Reads COMFY_API_KEY from the environment.
      # The SDK automatically creates an idempotency key and reuses it for automatic retries.
      with Comfy() as client:
          result = client.models.run(
              "ltx/ltx-2-5-pro",
              {
                  "duration": 2,
                  "fps": 24,
                  "generate_audio": False,
                  "prompt": "A single red maple leaf resting on a plain white background.",
                  "resolution": "1280x720",
              },
          )

      print(result)
      ```

      ```typescript TypeScript theme={null}
      import { comfy } from "@comfyorg/sdk";

      // Reads COMFY_API_KEY from the environment.
      // The SDK automatically creates an idempotency key and reuses it for automatic retries.
      const { data } = await comfy.models.run("ltx/ltx-2-5-pro", {
        duration: 2,
        fps: 24,
        generate_audio: false,
        prompt: "A single red maple leaf resting on a plain white background.",
        resolution: "1280x720",
      });

      console.log(data);
      ```

      ```bash cURL theme={null}
      curl https://api.comfy.org/v2/models/ltx/ltx-2-5-pro \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"duration\": 2, \"fps\": 24, \"generate_audio\": false, \"prompt\": \"A single red maple leaf resting on a plain white background.\", \"resolution\": \"1280x720\"}"
      ```
    </CodeGroup>
  </Tab>

  <Tab title="실행 대기열에 넣고 나중에 수집">
    동일한 본문을 `POST https://api.comfy.org/v2/models/ltx/ltx-2-5-pro/requests`로 전송합니다. Router는 실행이 승인되는 즉시 `request_id`와 함께 `201`로 응답하며, 결과는 준비가 되면 이 프로세스에서든 다른 프로세스에서든 수집합니다. [대기열 방식 전달](/ko/development/comfy-router/queue)에서 상태, 취소, 수집 과정을 살펴봅니다.

    <CodeGroup>
      ```python Python theme={null}
      from comfy_sdk import Comfy

      # Reads COMFY_API_KEY from the environment.
      # Each submit() call mints its own Idempotency-Key and reuses it for automatic retries.
      with Comfy() as client:
          handle = client.models.submit(
              "ltx/ltx-2-5-pro",
              {
                  "duration": 2,
                  "fps": 24,
                  "generate_audio": False,
                  "prompt": "A single red maple leaf resting on a plain white background.",
                  "resolution": "1280x720",
              },
          )
          print("request_id:", handle.request_id)  # with the model ID, all another process needs

          # Poll until the request completes, waiting the Retry-After the server names.
          for update in handle.iter_events():
              print(update.status, update.queue_position)

          # The provider's own payload, the same value models.run() returns.
          # A request that failed or was cancelled raises the typed Router error here.
          result = handle.get()

      print(result)
      ```

      ```typescript TypeScript theme={null}
      import { comfy } from "@comfyorg/sdk";

      // Reads COMFY_API_KEY from the environment.
      // Each submit() call mints its own Idempotency-Key and reuses it for automatic retries.
      const handle = await comfy.models.submit("ltx/ltx-2-5-pro", {
        duration: 2,
        fps: 24,
        generate_audio: false,
        prompt: "A single red maple leaf resting on a plain white background.",
        resolution: "1280x720",
      });
      console.log("requestId:", handle.requestId); // with the model ID, all another process needs

      // Poll until the request completes, waiting the Retry-After the server names.
      for await (const update of handle.events()) {
        console.log(update.status, update.queuePosition);
      }

      // The same result models.run() returns. A request that failed or was cancelled rejects here.
      const result = await handle.get();

      console.log(result.data);
      ```

      ```bash cURL theme={null}
      # 1. Submit. Router answers 201 with request_id, status_url, response_url and cancel_url.
      curl https://api.comfy.org/v2/models/ltx/ltx-2-5-pro/requests \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"duration\": 2, \"fps\": 24, \"generate_audio\": false, \"prompt\": \"A single red maple leaf resting on a plain white background.\", \"resolution\": \"1280x720\"}"

      # 2. Poll until status is COMPLETED, waiting the Retry-After seconds each response names.
      REQUEST_ID="<request_id from the 201 body>"
      curl -i https://api.comfy.org/v2/models/ltx/ltx-2-5-pro/requests/$REQUEST_ID/status \
        -H "X-API-Key: $COMFY_API_KEY"

      # 3. Collect. 200 with the model's native output, 202 with the status body while it is still running.
      curl https://api.comfy.org/v2/models/ltx/ltx-2-5-pro/requests/$REQUEST_ID \
        -H "X-API-Key: $COMFY_API_KEY"
      ```
    </CodeGroup>
  </Tab>
</Tabs>

<h2 id="schema">
  Schema
</h2>

### Input

<ParamField body="duration" type="integer" required>
  비디오 재생 시간(초)입니다(최대값은 해상도와 프레임 레이트에 따라 달라집니다).

  가능한 값: `2`, `3`, `4`, `5`, `6`, `8`, `10`, `12`, `14`, `16`, `18`, `20`
</ParamField>

<ParamField body="fps" type="integer" default="25">
  초당 프레임 수 단위의 프레임 레이트입니다.

  가능한 값: `24`, `25`, `48`, `50`
</ParamField>

<ParamField body="generate_audio" type="boolean" default="true">
  비디오용 오디오를 생성합니다.
</ParamField>

<ParamField body="model" type="string">
  생성에 사용할 모델입니다. Comfy Router 경로 `POST /v2/models/ltx/{model}`에서는 이 필드가 경로에서 제공되므로 생략할 수 있습니다. 이 작업에서 LTX가 제공하는 표기, 즉 Comfy Router가 `ltx/<model>`로 주소 지정하는 집합은 ltx-2-5-fast와 ltx-2-5-pro입니다. 위 주석에 제시된 이유로 여기서는 enum으로 제한하지 않고 그대로 나열합니다. 각 모델이 허용하는 해상도는 아래 `resolution` 속성의 `x-comfy-model-resolutions` 매트릭스에 있습니다.
</ParamField>

<ParamField body="prompt" type="string" required>
  원하는 비디오 콘텐츠를 설명하는 텍스트 프롬프트입니다.
</ParamField>

<ParamField body="resolution" type="string" required>
  출력 비디오 해상도입니다. enum은 모든 모델에 대한 합집합이며, 지원되는 집합은 모델별로 다릅니다. 지원되는 조합: ltx-2-5-fast: 1280x720, 720x1280, 1920x1080, 1080x1920, 2560x1440, 1440x2560, 3840x2160, 2160x3840; ltx-2-5-pro: 1280x720, 720x1280, 1920x1080, 1080x1920. 그 밖의 (모델, 해상도) 조합은 지원되지 않으며, v2 경로는 이를 400으로 거부합니다. 동일한 매트릭스가 이 속성의 x-comfy-model-resolutions 확장에 기계 판독 가능한 형태로 게시되어 있습니다.

  가능한 값: `1280x720`, `720x1280`, `1920x1080`, `1080x1920`, `2560x1440`, `1440x2560`, `3840x2160`, `2160x3840`
</ParamField>

Router가 `GET /v2/models/ltx/ltx-2-5-pro/openapi.json`에서 제공하는 스키마를 기반으로 생성되었으며, 이는 요청이 공급자에게 도달하기 이전에 호출을 검증하는 데 사용하는 동일한 문서입니다.

### Output

<ResponseField name="completed_at" type="string">
  작업 완료 타임스탬프(ISO 8601)
</ResponseField>

<ResponseField name="created_at" type="string">
  작업 생성 타임스탬프(ISO 8601)
</ResponseField>

<ResponseField name="error" type="object">
  status가 failed일 때 존재합니다.
</ResponseField>

<ResponseField name="error.message" type="string" />

<ResponseField name="error.type" type="string" />

<ResponseField name="id" type="string">
  고유한 작업 식별자
</ResponseField>

<ResponseField name="result" type="object">
  status가 completed일 때 존재합니다. 출력 URL은 완료 후 24시간 뒤에 만료됩니다.
</ResponseField>

<ResponseField name="result.video_url" type="string">
  생성된 비디오의 URL
</ResponseField>

<ResponseField name="status" type="string">
  작업 상태(pending, processing, completed, failed)
</ResponseField>

## 예시

### 입력

```json theme={null}
{
  "duration": 2,
  "fps": 24,
  "generate_audio": false,
  "prompt": "A single red maple leaf resting on a plain white background.",
  "resolution": "1280x720"
}
```

### 출력

```json theme={null}
{
  "completed_at": "2026-01-01T00:02:10Z",
  "created_at": "2026-01-01T00:00:00Z",
  "id": "3f7a1b28-5c0d-4e91-8a6f-1b2c3d4e5f60",
  "result": {
    "video_url": "https://example.invalid/ltx/generated.mp4"
  },
  "status": "completed"
}
```

## 배포 전 확인

SDK는 `Idempotency-Key`를 생성하고 자동 재시도에서 재사용합니다. 수동 재시도 시에는 원래 키를 재사용하세요. Router는 연결을 최대 10분간 유지할 수 있습니다.

요청이 실패하면 Router는 이유를 설명하는 `X-Comfy-Error-Type` 응답 헤더를 보냅니다. `422`는 Router가 프로바이더를 호출하기 전에 입력을 거부했음을 의미합니다. 생성된 에셋은 [결과 URL이 만료](/ko/development/comfy-router/reference#결과-에셋)될 수 있으므로 즉시 다운로드하세요.

<CardGroup cols={3}>
  <Card title="헤더" icon="list" href="/ko/development/comfy-router/quickstart">
    인증, 멱등성, 요청 ID, 오류 분류, 재시도 간격, 지출 한도.
  </Card>

  <Card title="Router API 사용" icon="code" href="/ko/development/comfy-router/quickstart">
    모델 검색, 유효성 검사 오류, 재시도, 과금.
  </Card>

  <Card title="제한 사항" icon="triangle-exclamation" href="/ko/development/comfy-router/limitations">
    Router가 현재 지원하지 않는 기능과 대체 방법.
  </Card>
</CardGroup>
