Files
1hew-ComfyUI-1hewNodes/web/docs/1hew_IntImageSideLength/zh.md
T

32 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Int Image Side Length - 图像宽/高/最长/最短边
**节点功能:** `Int Image Side Length` 基于输入图像尺寸返回一个整数:可选择最长边、最短边、宽度或高度。用于尺寸感知的流程中设定或校验下游参数。
## 输入
| 参数名称 | 入端选择 | 数据类型 | 默认值 | 取值范围 | 描述 |
| -------- | -------- | -------- | ------ | -------- | ---- |
| `image` | - | IMAGE | - | - | 输入图像批次(`B×H×W×C`);仅使用空间尺寸。 |
| `mode` | - | COMBO | `shortest` | `longest` / `shortest` / `width` / `height` | 选择输出的边长类型。 |
## 输出
| 输出名称 | 数据类型 | 描述 |
|---------|----------|------|
| `int` | INT | 选定边长的像素值。 |
## 功能说明
- 尺寸读取:从图像提取 `H`、`W` 并按 `mode` 计算。
- 批次兼容:支持批量张量,假设各帧空间尺寸一致。
- 工具轻量:用于驱动尺寸相关参数,计算开销低。
## 典型用法
- 控制缩放:作为目标边长输入,配合通用缩放或填充/裁剪逻辑。
- 输入校验:依据宽/高范围进行条件判断或流程分支。
## 注意与建议
- 假设图像张量布局为 `B×H×W×C`;通道维度不参与计算。
- 批量输入时建议各帧 `H/W` 一致,以获得确定性输出。