> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-recommend-assets-api.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.

> 本文档由 AI 生成。如果您发现任何错误或有改进建议，欢迎贡献！ [在 GitHub 上编辑](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/TextGenerateLTX2Prompt/zh.md)

TextGenerateLTX2Prompt 节点是一个专门化的文本生成节点。它接收用户的文本提示，在发送给语言模型进行增强或补全之前，会自动使用特定的系统指令对其进行格式化。该节点可在两种模式下运行：纯文本模式或带图像参考模式，每种情况使用不同的系统提示。

## 输入参数

| 参数名             | 数据类型   | 必填 | 取值范围                                                          | 描述                                     |
| --------------- | ------ | -- | ------------------------------------------------------------- | -------------------------------------- |
| `clip`          | CLIP   | 是  |                                                               | 用于文本编码的 CLIP 模型。                       |
| `prompt`        | STRING | 是  |                                                               | 来自用户的原始文本输入，将被增强或补全。                   |
| `max_length`    | INT    | 是  |                                                               | 允许语言模型生成的最大令牌数量。                       |
| `sampling_mode` | COMBO  | 是  | `"greedy"`<br />`"top_k"`<br />`"top_p"`<br />`"temperature"` | 在文本生成过程中用于选择下一个令牌的采样策略。                |
| `image`         | IMAGE  | 否  |                                                               | 可选的输入图像。当提供时，节点会使用一个包含图像上下文占位符的不同系统提示。 |

**注意：** 节点的行为会根据 `image` 输入是否存在而改变。如果提供了图像，生成的提示将被格式化为图像到视频任务。如果未提供图像，则格式化为文本到视频任务。

## 输出结果

| 输出名称     | 数据类型   | 描述                    |
| -------- | ------ | --------------------- |
| `output` | STRING | 由语言模型生成的增强或补全后的文本字符串。 |
