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

# TruncateText - ComfyUI Built-in Node Documentation

> Complete documentation for the TruncateText 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/TruncateText/zh.md)

此节点通过将文本截断至指定最大长度来缩短文本。它接收任意输入文本，仅返回您设置字符数以内的前段内容。这是一种确保文本不超过特定大小的简单方法。

## 输入参数

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

## 输出结果

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