1.4 KiB
1.4 KiB
Int Mask Side Length - Mask width/height/longest/shortest
Node Purpose: Int Mask Side Length returns a single integer based on the input mask size: longest side, shortest side, width, or height. Useful for driving downstream parameters (e.g., target side length) in size-aware workflows.
Inputs
| Name | Port | Type | Default | Range | Description |
|---|---|---|---|---|---|
mask |
- | MASK | - | - | Input mask batch (B×H×W); only its spatial size is used. |
mode |
- | COMBO | shortest |
longest / shortest / width / height |
Select which side length to output. |
Outputs
| Name | Type | Description |
|---|---|---|
int |
INT | Selected side length in pixels. |
Features
- Size extraction: reads
HandWfrom mask and computes permode. - Batch-friendly: works with mask batches; dimensions are taken from tensor shape.
- Zero overhead: minimal computation, ideal for parameter control.
Typical Usage
- Drive resizing: feed into nodes that require a target side length (e.g., longest side).
- Conditional flows: branch by width/height values to select processing paths.
Notes & Tips
- Expects standard mask shape
B×H×Wwith numeric values; only dimensions matter here. - When masks are batched, all frames should share the same spatial size for deterministic outputs.