> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/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?onboarding=router)でキーを作成し、`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`

> [tab] 結果を待つ
>
> ```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-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";
>
> // 環境変数から COMFY_API_KEY を読み取ります。
> // SDK は冪等キーを自動的に作成し、自動リトライのために再利用します。
> 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\"}"
> ```

> [tab] キューに送信して後で収集する
>
> 同じボディを `POST https://api.comfy.org/v2/models/ltx/ltx-2-5-fast/requests` に送信します。Router は実行が受け付けられるとすぐに `201` と `request_id` を返し、結果は準備ができ次第、このプロセスからでも別のプロセスからでも収集できます。[キュー配信](https://docs.comfy.org/ja/development/comfy-router/queue.md)では、ステータス、キャンセル、収集の流れを順を追って説明します。
>
> ```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-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)  # モデル 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-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); // モデル 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 は request_id、status_url、response_url、cancel_url とともに 201 を返します。
> 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. status が COMPLETED になるまでポーリングし、各レスポンスが指定する Retry-After 秒だけ待機します。
> 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. 収集。200 はモデル固有の出力、202 はまだ実行中の場合のステータスボディです。
> curl https://api.comfy.org/v2/models/ltx/ltx-2-5-fast/requests/$REQUEST_ID \
>   -H "X-API-Key: $COMFY_API_KEY"
> ```

## スキーマ

### 入力

**duration** `integer` *required*

ビデオの再生時間（秒単位、最大値は解像度とフレームレートによって異なります）

指定可能な値: `2`, `3`, `4`, `5`, `6`, `8`, `10`, `12`, `14`, `16`, `18`, `20`

**fps** `integer` (default: 25)

フレームレート（1 秒あたりのフレーム数）

指定可能な値: `24`, `25`, `48`, `50`

**generate\_audio** `boolean` (default: true)

ビデオのオーディオを生成します

**model** `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` マトリクスに示されています。

**prompt** `string` *required*

生成したいビデオの内容を記述するテキストプロンプト

**resolution** `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`

Router が `GET /v2/models/ltx/ltx-2-5-fast/openapi.json` で提供するスキーマから生成されています。これは、リクエストがプロバイダーに到達する前に Router が呼び出しを検証する対象となるドキュメントと同じものです。

### 出力

**completed\_at** `string`

ジョブの完了タイムスタンプ（ISO 8601）

**created\_at** `string`

ジョブの作成タイムスタンプ（ISO 8601）

**error** `object`

status が failed の場合に存在します

**error.message** `string`

**error.type** `string`

**id** `string`

一意のジョブ識別子

**result** `object`

status が completed の場合に存在します。出力 URL は完了から 24 時間後に失効します

**result.video\_url** `string`

生成済みビデオの URL

**status** `string`

ジョブのステータス（pending、processing、completed、failed）

## 例

### 入力

```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 の有効期限](https://docs.comfy.org/ja/development/comfy-router/reference.md#結果アセット) があるため、早めにダウンロードしてください。

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

このページは、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](https://docs.comfy.org/ja/development/api-development/sdks.md) を参照してください。

> [card] [ヘッダー](https://docs.comfy.org/ja/development/comfy-router/headers.md)
>
> 認証、冪等性、リクエスト ID、エラー分類、リトライ間隔、支出上限。

> [card] [Router API の利用](https://docs.comfy.org/ja/development/comfy-router/api.md)
>
> モデルの検出、バリデーションエラー、リトライ、課金。

> [card] [制限事項](https://docs.comfy.org/ja/development/comfy-router/limitations.md)
>
> Router が現在対応していないことと、代替手段。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.