> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-custom-nodes-sdk-v2-frontend.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# TextGenerateLTX2Prompt - ComfyUI Built-in Node Documentation

> The TextGenerateLTX2Prompt node expands a short user prompt into a detailed, audio-visual description suitable for generating video with the LTX-2 series of video models.

The TextGenerateLTX2Prompt node expands a short user prompt into a detailed, audio-visual description suitable for generating video with the LTX-2 series of video models. It automatically adds task-specific system instructions, sends the formatted prompt to a language model, and returns the enhanced text. When an optional reference image is supplied, the node switches to image-to-video mode and expands the prompt starting from that image's content.

## Inputs

| Parameter              | Description                                                                                                                                                                                                            | Data Type | Required | Range                                                         |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -------- | ------------------------------------------------------------- |
| `clip`                 | The CLIP model used for text encoding. The node checks the model's tokenizer name to select the matching instructions: Gemma 4 based models use the LTX-2.4 format, while other models use the LTX-2 (Gemma 3) format. | CLIP      | Yes      |                                                               |
| `prompt`               | The raw text input describing the scene or concept to be expanded into a detailed video generation prompt.                                                                                                             | STRING    | Yes      |                                                               |
| `max_length`           | The maximum number of tokens the language model is allowed to generate.                                                                                                                                                | INT       | Yes      |                                                               |
| `sampling_mode`        | The sampling strategy used to select the next token during text generation.                                                                                                                                            | COMBO     | Yes      | `"greedy"`<br />`"top_k"`<br />`"top_p"`<br />`"temperature"` |
| `image`                | An optional input image used as the first frame of the video. When provided, the node switches to image-to-video mode and uses a system prompt that expands the user prompt based on the image's content.              | IMAGE     | No       |                                                               |
| `thinking`             | When enabled, the model is instructed to reason before answering. Any reasoning block is removed from the returned output (default: False).                                                                            | BOOLEAN   | No       |                                                               |
| `use_default_template` | When enabled, the node uses the default chat template for formatting (default: True).                                                                                                                                  | BOOLEAN   | No       |                                                               |
| `video`                | An optional video input that can be used as additional context for generation.                                                                                                                                         | VIDEO     | No       |                                                               |
| `audio`                | An optional audio input that can be used as additional context for generation.                                                                                                                                         | AUDIO     | No       |                                                               |

**Note:** The behavior of the node changes based on its inputs:

* If an `image` is provided, the generated prompt is formatted for an image-to-video task using a system prompt that describes how to expand the prompt based on the image's content. If no image is provided, the formatting is for a text-to-video task using a system prompt that expands the prompt into a detailed video generation description.
* If the CLIP tokenizer's name contains "gemma4", the node uses the LTX-2.4 system prompts and the Gemma 4 chat format. Otherwise, it uses the LTX-2 (Gemma 3) system prompts and chat format.
* If the language model produces no usable text after removing reasoning blocks, the node returns the original `prompt` instead.

## Outputs

| Output Name | Description                                                                                                                                                          | Data Type |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `output`    | The enhanced video-generation prompt produced by the language model, with any reasoning block removed. If the result is empty, the original user prompt is returned. | STRING    |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/TextGenerateLTX2Prompt/en.md)

***

**Source fingerprint (SHA-256):** `8f524ea60a247217dde8a1edaf7a689e253ae05acc9eb52ad47b91e879dba1df`
