> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-feat-openapi-i18n.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# TextGenerateLTX2Prompt - ComfyUI Built-in Node Documentation

> Complete documentation for the TextGenerateLTX2Prompt node in ComfyUI. Learn its inputs, outputs, parameters and usage.

The TextGenerateLTX2Prompt node is a specialized version of a text generation node. It takes a user's text prompt and automatically formats it with specific system instructions before sending it to a language model for enhancement or completion. The node can operate in two modes: text-only or with an image reference, using different system prompts for each case.

## Inputs

| Parameter              | Description                                                                                                                    | Data Type | Required | Range                                                         |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------- | -------- | ------------------------------------------------------------- |
| `clip`                 | The CLIP model used for text encoding.                                                                                         | CLIP      | Yes      |                                                               |
| `prompt`               | The raw text input from the user that will be enhanced or completed.                                                           | 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. When provided, the node uses a different system prompt that includes a placeholder for image context. | IMAGE     | No       |                                                               |
| `thinking`             | When enabled, the model will output its reasoning process before the final answer.                                             | BOOLEAN   | No       |                                                               |
| `use_default_template` | When enabled, the node will use the default chat template for formatting.                                                      | 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 the presence of the `image` input. If an image is provided, the generated prompt will be 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 will be for a text-to-video task using a system prompt that expands the prompt into a detailed video generation description.

## Outputs

| Output Name | Description                                                            | Data Type |
| ----------- | ---------------------------------------------------------------------- | --------- |
| `output`    | The enhanced or completed text string generated by the language model. | 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):** `c037e526efab4b4e8eeeb84b4374d33a295996632b9897259806502ca32f48e1`
