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

# TripoSplatPreprocessImage - ComfyUI Built-in Node Documentation

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

# TripoSplat 图像预处理节点

此节点将每张输入图像裁剪为黑色背景上的居中正方形，然后添加填充以达到指定的输出尺寸。它旨在通过确保一致的方形构图和可选的 Alpha 遮罩腐蚀来防止边框伪影，从而为 TripoSplat 3D 模型准备图像。

## ## 输入

| 参数             | 描述                                               | 数据类型  | 是否必需 | 范围                |
| -------------- | ------------------------------------------------ | ----- | ---- | ----------------- |
| `image`        | 待预处理的输入图像                                        | IMAGE | 是    | -                 |
| `mask`         | 图像的 Alpha 遮罩，用于确定裁剪区域                            | MASK  | 是    | -                 |
| `erode_radius` | 在裁剪前按此像素半径腐蚀 Alpha 遮罩（避免边框渗色）。默认值：1              | INT   | 是    | 0 到 16            |
| `size`         | 正方形图像尺寸。模型在 1024 尺寸上训练；其他尺寸也可运行但属于分布外情况。默认值：1024 | INT   | 是    | 256 到 4096（步长 16） |

**注意：** `mask` 输入为必需项且必须提供。如果遮罩的批次大小与图像不同，则会自动重复以匹配。如果遮罩尺寸与图像尺寸不同，则使用双线性插值将遮罩调整为与图像匹配。

## ## 输出

| 输出名称    | 描述                          | 数据类型  |
| ------- | --------------------------- | ----- |
| `image` | 预处理后的图像，裁剪为黑色背景上的居中正方形并带有填充 | IMAGE |

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

***

**Source fingerprint (SHA-256):** `3f33dbc3a99ccb23ede767915a28fabdfa388edb8d5782edea3f8d03e5965b2a`
