> ## Documentation Index
> Fetch the complete documentation index at: https://comfyuiwiki.com/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 を呼び出します: エンドポイント、リクエストの形状、Router が返すレスポンス。

`ltx/ltx-2-5-pro` の API リファレンスです。Comfy Router が LTX から提供しています。

## クイックスタート

[Comfy ワークスペース](https://platform.comfy.org/profile/api-keys?onboarding=router)でキーを作成し、`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 defaultTabIndex={1}>
  <Tab title="結果を待つ">
    <CodeGroup>
      ```python Python theme={null}
      from comfy_sdk import Comfy

      # 環境変数 COMFY_API_KEY を読み取ります。
      # SDK は冪等性キーを自動的に作成し、自動リトライのために再利用します。
      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";

      // 環境変数 COMFY_API_KEY を読み取ります。
      // SDK は冪等性キーを自動的に作成し、自動リトライのために再利用します。
      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 は実行が受け付けられるとすぐに `201` と `request_id` を返し、結果は準備ができ次第、このプロセスからでも別のプロセスからでも収集できます。[キュー配信](/ja/development/comfy-router/queue)では、ステータス、キャンセル、収集について説明します。

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

      # 環境変数 COMFY_API_KEY を読み取ります。
      # 各 submit() 呼び出しは独自の Idempotency-Key を発行し、自動リトライで再利用します。
      async def main():
          async with AsyncComfy() as client:
              handle = await 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)  # モデル ID と合わせれば、別のプロセスに必要な情報はこれだけです

              # リクエストが完了するまでポーリングし、サーバーが指定する Retry-After の秒数だけ待機します。
              async for update in handle.iter_events():
                  print(update.status, update.queue_position)

              # プロバイダー自身のペイロードで、models.run() が返す値と同じものです。
              # 失敗またはキャンセルされたリクエストは、ここで型付きの Router エラーを発生させます。
              result = await handle.get()

          print(result)

      asyncio.run(main())
      ```

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

      // 環境変数 COMFY_API_KEY を読み取ります。
      // 各 submit() 呼び出しは独自の Idempotency-Key を発行し、自動リトライで再利用します。
      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); // モデル ID と合わせれば、別のプロセスに必要な情報はこれだけです

      // リクエストが完了するまでポーリングし、サーバーが指定する Retry-After の秒数だけ待機します。
      for await (const update of handle.events()) {
        console.log(update.status, update.queuePosition);
      }

      // models.run() が返すのと同じ結果です。失敗またはキャンセルされたリクエストは、ここで reject されます。
      const result = await handle.get();

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

      ```bash cURL theme={null}
      # 1. 送信。Router は 201 とともに request_id、status_url、response_url、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. ステータスが COMPLETED になるまでポーリングし、各レスポンスが指定する Retry-After の秒数だけ待機します。
      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. 収集。200 はモデルのネイティブ出力、202 はまだ実行中であることを示すステータスボディを返します。
      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>

## スキーマ

### 入力

<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">
  フレームレート（1秒あたりのフレーム数）

  指定可能な値: `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。その他の (model, resolution) のペアは対応していません。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` で提供するスキーマから生成されています。これは、リクエストがプロバイダーに到達する前に Router が呼び出しを検証する際に使用する同一のドキュメントです。

### 出力

<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 が入力を拒否したことを意味し、`413` はリクエスト本文が Router の受け入れ可能なサイズを超えていたことを意味します。生成されたアセットは [結果 URL の有効期限](/ja/development/comfy-router/reference#結果アセット) があるため、早めにダウンロードしてください。

上記のフィールド説明に記載されているサイズ制限は、プロバイダーの仕様から引用した、そのフィールドに対するプロバイダー自身の上限です。Router はリクエスト本文全体に対して別の上限を適用し、base64 エンコードされたメディアもこれにカウントされます。[リクエスト本文のサイズ](/ja/development/comfy-router/limitations) を参照してください。

このページは、Comfy Router 経由で呼び出す 1 つのパートナーモデルについて説明しています。同じ `comfy-sdk` / `@comfyorg/sdk` パッケージには、Comfy Cloud 上で ComfyUI のワークフローグラフ全体を実行するための 2 つ目のクライアントも含まれています: `Comfy(api_key=...)` / `new Comfy({ apiKey })`、および `client.workflows`、`client.assets`、`client.jobs`。[Comfy SDKs](/ja/development/api-development/sdks) を参照してください。

<CardGroup cols={3}>
  <Card title="ヘッダー" icon="list" href="/ja/development/comfy-router/headers">
    認証、冪等性、リクエスト ID、エラー分類、リトライ間隔、支出上限。
  </Card>

  <Card title="Router API の利用" icon="code" href="/ja/development/comfy-router/api">
    モデルの検出、バリデーションエラー、リトライ、課金。
  </Card>

  <Card title="制限事項" icon="triangle-exclamation" href="/ja/development/comfy-router/limitations">
    Router が現在対応していないことと、代替手段。
  </Card>
</CardGroup>
