> ## 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.

# PixVerse テキストから動画へ - ComfyUI 組み込みノードのドキュメント

> PixVerse の AI 技術を用いて、テキストによる説明を動画に変換するノード

<img src="https://mintcdn.com/dripart/5003JSxULDwNImme/images/built-in-nodes/api_nodes/pixverse/pixverse-text-to-video.jpg?fit=max&auto=format&n=5003JSxULDwNImme&q=85&s=b565631bd9ca69e804d839e8d79a799c" alt="ComfyUI 組み込み PixVerse テキストから動画へノード" width="1731" height="1689" data-path="images/built-in-nodes/api_nodes/pixverse/pixverse-text-to-video.jpg" />

PixVerse テキストから動画へノードは、PixVerse のテキストから動画への API に接続し、ユーザーがテキストによる説明から高品質な動画を生成できるようにします。ユーザーは、動画の品質、再生時間、モーションモードなどの各種パラメーターを調整することで、創作ニーズに応じたカスタマイズが可能です。

## パラメーター

### 必須パラメーター

| パラメーター            | 型   | デフォルト値                    | 説明                  |
| ----------------- | --- | ------------------------- | ------------------- |
| prompt            | 文字列 | ""                        | 動画の内容を記述するテキストプロンプト |
| aspect\_ratio     | 選択肢 | -                         | 出力動画のアスペクト比         |
| quality           | 選択肢 | PixverseQuality.res\_540p | 動画の品質レベル            |
| duration\_seconds | 選択肢 | -                         | 動画の再生時間             |
| motion\_mode      | 選択肢 | -                         | 動画のモーションモード         |
| seed              | 整数  | 0                         | 生成結果の一貫性を保つための乱数シード |

### オプションパラメーター

| パラメーター             | 型                  | デフォルト値 | 説明                                             |
| ------------------ | ------------------ | ------ | ---------------------------------------------- |
| negative\_prompt   | 文字列                | ""     | 動画に含めたくない要素を指定するテキスト                           |
| pixverse\_template | PIXVERSE\_TEMPLATE | None   | スタイル設定に使用するオプションのテンプレート（PixVerse テンプレートノードで作成） |

### 制限事項

* 1080p 品質では、**normal** モーションモードと **5秒** の再生時間のみがサポートされます。
* 5秒以外の再生時間では、**normal** モーションモードのみがサポートされます。

### 出力

| 出力    | 型  | 説明      |
| ----- | -- | ------- |
| VIDEO | 動画 | 生成された動画 |

## ソースコード

\[ノードのソースコード（2025年5月5日更新）]

```python theme={null}

class PixverseTextToVideoNode(ComfyNodeABC):
    """
    Generates videos synchronously based on prompt and output_size.
    """

    RETURN_TYPES = (IO.VIDEO,)
    DESCRIPTION = cleandoc(__doc__ or "")  # Handle potential None value
    FUNCTION = "api_call"
    API_NODE = True
    CATEGORY = "api node/video/Pixverse"

    @classmethod
    def INPUT_TYPES(s):
        return {
            "required": {
                "prompt": (
                    IO.STRING,
                    {
                        "multiline": True,
                        "default": "",
                        "tooltip": "Prompt for the video generation",
                    },
                ),
                "aspect_ratio": (
                    [ratio.value for ratio in PixverseAspectRatio],
                ),
                "quality": (
                    [resolution.value for resolution in PixverseQuality],
                    {
                        "default": PixverseQuality.res_540p,
                    },
                ),
                "duration_seconds": ([dur.value for dur in PixverseDuration],),
                "motion_mode": ([mode.value for mode in PixverseMotionMode],),
                "seed": (
                    IO.INT,
                    {
                        "default": 0,
                        "min": 0,
                        "max": 2147483647,
                        "control_after_generate": True,
                        "tooltip": "Seed for video generation.",
                    },
                ),
            },
            "optional": {
                "negative_prompt": (
                    IO.STRING,
                    {
                        "default": "",
                        "forceInput": True,
                        "tooltip": "An optional text description of undesired elements on an image.",
                    },
                ),
                "pixverse_template": (
                    PixverseIO.TEMPLATE,
                    {
                        "tooltip": "An optional template to influence style of generation, created by the Pixverse Template node."
                    }
                )
            },
            "hidden": {
                "auth_token": "AUTH_TOKEN_COMFY_ORG",
            },
        }

    def api_call(
        self,
        prompt: str,
        aspect_ratio: str,
        quality: str,
        duration_seconds: int,
        motion_mode: str,
        seed,
        negative_prompt: str=None,
        pixverse_template: int=None,
        auth_token=None,
        **kwargs,
    ):
        # 1080p is limited to 5 seconds duration
        # only normal motion_mode supported for 1080p or for non-5 second duration
        if quality == PixverseQuality.res_1080p:
            motion_mode = PixverseMotionMode.normal
            duration_seconds = PixverseDuration.dur_5
        elif duration_seconds != PixverseDuration.dur_5:
            motion_mode = PixverseMotionMode.normal

        operation = SynchronousOperation(
            endpoint=ApiEndpoint(
                path="/proxy/pixverse/video/text/generate",
                method=HttpMethod.POST,
                request_model=PixverseTextVideoRequest,
                response_model=PixverseVideoResponse,
            ),
            request=PixverseTextVideoRequest(
                prompt=prompt,
                aspect_ratio=aspect_ratio,
                quality=quality,
                duration=duration_seconds,
                motion_mode=motion_mode,
                negative_prompt=negative_prompt if negative_prompt else None,
                template_id=pixverse_template,
                seed=seed,
            ),
            auth_token=auth_token,
        )
        response_api = operation.execute()

        if response_api.Resp is None:
            raise Exception(f"Pixverse request failed: '{response_api.ErrMsg}'")

        operation = PollingOperation(
            poll_endpoint=ApiEndpoint(
                path=f"/proxy/pixverse/video/result/{response_api.Resp.video_id}",
                method=HttpMethod.GET,
                request_model=EmptyRequest,
                response_model=PixverseGenerationStatusResponse,
            ),
            completed_statuses=[PixverseStatus.successful],
            failed_statuses=[PixverseStatus.contents_moderation, PixverseStatus.failed, PixverseStatus.deleted],
            status_extractor=lambda x: x.Resp.status,
            auth_token=auth_token,
        )
        response_poll = operation.execute()

        vid_response = requests.get(response_poll.Resp.url)
        return (VideoFromFile(BytesIO(vid_response.content)),)
```
