> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-matt-router-pricing-pika-and-guard.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ResizeAndPadImage - ComfyUI Built-in Node Documentation

> ResizeAndPadImage 节点用于将图像调整至指定尺寸范围内，同时保持原始宽高比。

ResizeAndPadImage 节点用于将图像调整至指定尺寸范围内，同时保持原始宽高比。它会按比例缩小图像以适配目标宽度和高度，然后在边缘添加填充以填补剩余空间。填充颜色和插值方法可自定义，以控制填充区域的外观和缩放质量。

## 输入

| 参数 | 描述 | 数据类型 | 是否必填 | 取值范围 |
| - | - | - | - | - |
| `图像` | 待调整大小并填充的输入图像 | IMAGE | 是 | - |
| `目标宽度` | 输出图像的期望宽度（默认值：512） | INT | 是 | 1 至 MAX\_RESOLUTION |
| `目标高度` | 输出图像的期望高度（默认值：512） | INT | 是 | 1 至 MAX\_RESOLUTION |
| `填充颜色` | 用于填充缩放后图像周围区域的颜色（默认值："white"） | COMBO | 是 | "white"<br />"black" |
| `插值方法` | 用于调整图像大小的插值方法（默认值："area"） | COMBO | 是 | "area"<br />"bicubic"<br />"nearest-exact"<br />"bilinear"<br />"lanczos" |

## 输出

| 输出名称 | 描述 | 数据类型 |
| - | - | - |
| `图像` | 调整大小并填充后的输出图像 | IMAGE |

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

***

**Source fingerprint (SHA-256):** `01566327d46043d1ff9ce404b4df8f49e853d0b01d07cc189fb843157dac1cac`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.