v3.0.6 Add Mask Repeat, Get File Count, Load Image From Folder, and Load Video From Folder nodes

This commit is contained in:
yige1127
2025-12-14 20:51:33 +08:00
parent de3dae4ac7
commit c02dc0fa2e
37 changed files with 2006 additions and 67 deletions
-39
View File
@@ -1,39 +0,0 @@
# Multi Mask Math Ops - Binary Mask Operations
**Node Purpose:** `Mask Math Ops` performs per-pixel binary-like operations between two masks: `or`, `and`, `subtract (a-b)`, `subtract (b-a)`, and `xor`. Handles batch cycling and resizes masks to match when sizes differ.
## Inputs
| Name | Port | Type | Default | Range | Description |
| ---- | ---- | ---- | ------- | ----- | ----------- |
| `mask_1` | - | MASK | - | - | First mask batch. |
| `mask_2` | - | MASK | - | - | Second mask batch; resized to `mask_1` size when needed. |
| `operation` | - | COMBO | `or` | `or` / `and` / `subtract (a-b)` / `subtract (b-a)` / `xor` | Operation type.
## Outputs
| Name | Type | Description |
|------|------|-------------|
| `mask` | MASK | Resulting mask batch.
## Features
- Batch cycling: aligns differing batch sizes by indexing modulo per item.
- Size alignment: resizes `mask_2` to `mask_1` with Lanczos when shapes differ.
- Operations:
- `and`: min of arrays.
- `or`: max of arrays.
- `subtract (a-b)`: `clip(a-b, 0, 1)`.
- `subtract (b-a)`: `clip(b-a, 0, 1)`.
- `xor`: absolute difference.
## Typical Usage
- Combine masks: union/intersection of regions for composite selection.
- Cutouts: subtract one region from another to refine selections.
- Edge emphasis: `xor` highlights differences between masks.
## Notes & Tips
- Inputs are treated as float `[0,1]` arrays internally; operations are per-channel on single-channel masks.
- Ensure consistent semantic meaning of mask intensity (white=selected) across inputs before combining.
-40
View File
@@ -1,40 +0,0 @@
# Multi Mask Math Ops - 遮罩二值运算
**节点功能:** `Mask Math Ops` 在多个遮罩之间执行逐像素二值化运算:`or`、`and`、`subtract (a-b)`、`subtract (b-a)`、`xor`。支持动态输入端口 `mask_1..mask_N`、批次广播与统一尺寸对齐。
## 输入
| 参数名称 | 入端选择 | 数据类型 | 默认值 | 取值范围 | 描述 |
| -------- | -------- | -------- | ------ | -------- | ---- |
| `mask_1` | - | MASK | - | - | 第一遮罩批次 |
| `mask_2..mask_N` | - | MASK | - | - | 动态遮罩输入;UI 尾部自动追加空槽以便继续连接 |
| `operation` | - | COMBO | `or` | `or` / `and` / `subtract (a-b)` / `subtract (b-a)` / `xor` | 运算类型 |
## 输出
| 输出名称 | 数据类型 | 描述 |
|---------|----------|------|
| `mask` | MASK | 运算后的遮罩批次 |
## 功能说明
- 动态端口:以 `mask_` 开头的输入端口支持自动扩展,始于 `mask_1、mask_2`,连接尾端空槽时自动追加,仅保留一个尾部空槽。
- 批次广播:当各输入批次大小不一致时,按索引取模进行对齐与计算。
- 尺寸统一:将所有输入遮罩统一到 `mask_1` 的尺寸,使用 Lanczos 重采样对齐。
- 运算规则:
- `and`:对所有遮罩逐像素取最小值(折叠)。
- `or`:对所有遮罩逐像素取最大值(折叠)。
- `subtract (a-b)`:从 `mask_1` 开始依次减去后续遮罩,结果钳制到 `[0,1]`。
- `subtract (b-a)`:若存在 `mask_2`,初始为 `clip(mask_2 - mask_1, 0, 1)`,随后依序减去其余遮罩;仅一个输入时返回 `mask_1`。
- `xor`:顺序绝对差折叠,强调输入遮罩间差异区域。
## 典型用法
- 遮罩组合:区域并/交以构建复合选区。
- 区域裁除:相互减法以精细化选区边界。
- 差异强调:`xor` 用于突显两遮罩的差异区域。
## 注意与建议
- 输入内部作为 `[0,1]` 浮点数组处理;单通道遮罩按逐像素运算。
- 在合并前确保遮罩强度语义一致(白=选中),避免语义冲突。