> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# 图像缩放到最大尺寸（ImageScaleToMaxDimension）

<div class="node-meta"><code>ImageScaleToMaxDimension</code><span>image/upscaling</span><span>角色：图像处理</span></div>

ImageScaleToMaxDimension 节点用于将图像调整至指定的最大尺寸范围内，同时保持原始宽高比。它会判断图像是竖屏还是横屏方向，然后将较大的尺寸缩放至目标大小，并按比例调整较小的尺寸。该节点支持多种放大方法，以满足不同的质量和性能需求。

## 参数

| 参数               | 类型         | 默认 / 范围                                    | 说明                                       |
| ---------------- | ---------- | ------------------------------------------ | ---------------------------------------- |
| `image`          | IMAGE · 图像 | —（连线输入）                                    | RGB 图像输入；尺寸不一致会被缩放或裁切。                   |
| `upscale_method` | COMBO      | area、lanczos、bilinear、nearest-exact …共 6 项 | nearest-exact 最快、lanczos 最锐、bicubic 最均衡。 |
| `largest_size`   | INT        | 0 \~ 16384                                 | —                                        |

## 输出

| 输出    | 类型    | 说明 |
| ----- | ----- | -- |
| IMAGE | IMAGE | 图像 |

## 怎么接

- **上游**：LoadImage / VAEDecode
- **下游**：VAEEncode / SaveImage / 下一个图像节点
- **接线**：接在 LoadImage 或 VAEDecode 之后，处理结果再交给 VAEEncode（重绘）、SaveImage（出图）或下一个图像节点；这类节点可以任意串联成处理流水线。

## 使用案例

属于「图像处理」类节点，向下游提供图像数据。从 `image`、`upscale_method`（area、lanczos、bilinear、nearest-exact …共 6 项）、`largest_size`（512） 开始填就能跑起来。典型接法：`LoadImage` → 本节点 → `VAEEncode`。输出类型是 IMAGE，只能接同类型的输入端口，颜色对不上就是接错了。

## 端口与连线示意

![ImageScaleToMaxDimension 端口与连线示意](/svg/ImageScaleToMaxDimension.svg)

## 同类节点

[缩放图像](/nodes/05/ImageScale.md) · [缩放图像（比例）](/nodes/05/ImageScaleBy.md) · [缩放图像（像素）](/nodes/05/ImageScaleToTotalPixels.md) · [使用模型放大图像](/nodes/05/ImageUpscaleWithModel.md)
