> ## 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 Fast を使用する

> Comfy Router 経由で ltx/ltx-2-5-fast を呼び出します: エンドポイント、リクエスト形状、Router が返すレスポンスについて。

`ltx/ltx-2-5-fast` のAPIリファレンス。LTX から Comfy Router によって提供されています。

## クイックスタート

[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-fast`

**エンドポイント:** `POST https://api.comfy.org/v2/models/ltx/ltx-2-5-fast`

<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-fast",
              {
                  "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-fast", {
        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-fast \
        -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-fast/requests` に送信します。Router は実行が受け付けられるとすぐに `201` と `request_id` を返し、結果は準備ができ次第、このプロセスからでも別のプロセスからでも収集できます。[キューによる配信](/ja/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-fast",
              {
                  "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-fast", {
        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-fast/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-fast/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-fast/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-fast/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 が入力を拒否したことを意味します。生成されたアセットは [結果 URL の有効期限](/ja/development/comfy-router/reference#結果アセット) があるため、早めにダウンロードしてください。

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

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

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