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

# TruncateText - ComfyUI Built-in Node Documentation

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

此节点通过在指定最大长度处截断文本来缩短文本。它接收任意输入文本，仅返回从开头到您设置的字符数部分。这是一种确保文本不超过特定大小的简单方法。

## 输入

| 参数     | 描述                             | 数据类型   | 必填 | 范围        |
| ------ | ------------------------------ | ------ | -- | --------- |
| `text` | 需要截断的文本字符串。                    | STRING | 是  | 不适用       |
| `长度上限` | 最大文本长度。文本将在达到此字符数后被截断（默认值：77）。 | INT    | 是  | 1 到 10000 |

## 输出

| 输出名称 | 描述                           | 数据类型   |
| ---- | ---------------------------- | ------ |
| `文本` | 截断后的文本，仅包含输入文本的前 `长度上限` 个字符。 | STRING |

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

***

**Source fingerprint (SHA-256):** `271a77a910967c4fd86a07485449679fb8db89f6b3f2bf0a8fa2ff224ea2f7b2`
