Files
1hew-ComfyUI-1hewNodes/web/docs/1hew_IntSplit/zh.md
T
2025-11-18 18:35:12 +08:00

36 lines
1.6 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 Split - 整数分割
**节点功能:** `Int Split` 将总量 `total` 按 `split_point` 进行分割。当 `split_point` 位于 `0.0–1.0` 范围内时采用比例分割,否则采用绝对数值分割。
## 输入
| 参数名称 | 入端选择 | 数据类型 | 默认值 | 取值范围 | 描述 |
| -------- | -------- | -------- | ------ | -------- | ---- |
| `total` | - | INT | `20` | `1–10000` | 待分割的总整数。 |
| `split_point` | - | FLOAT | `0.5` | `0.0–10000.0` | 比例或绝对分割值。`0.0–1.0` 为比例模式;`1.0` 输出 `1`;大于 `1.0` 时为绝对模式并对结果进行不超过 `total` 的钳制。 |
## 输出
| 输出名称 | 数据类型 | 描述 |
|---------|----------|------|
| `int_total` | INT | 输入 `total` 的回显。 |
| `int_split` | INT | 由 `split_point` 计算得到的分割数量。 |
## 功能说明
- 比例模式:`0.0–1.0` 时以 `total×split_point` 计算并取整。
- 特殊规则:当 `split_point=1.0` 时直接输出 `1`,便于单元分配语义。
- 绝对模式:当值大于 `1.0` 时按整数处理并最多不超过 `total`。
- 非负保障:最终结果下限固定为 `0`。
- 核心逻辑:比例与绝对值分割的计算与钳制。
## 典型用法
- 比例分割:设置 `split_point=0.25` 获得 `total` 的四分之一。
- 固定数量:设置 `split_point=8` 以请求 8 个单元(最多不超过 `total`)。
- 单元输出:设置 `split_point=1.0` 始终得到 `1`。
## 注意与建议
- 建议提供 `total≥1` 以确保分割结果更具意义。
- 绝对模式下过大的 `split_point` 会被安全钳制到 `total`。