ComfyUI Node
Advanced Shape Placement
Advanced shape placement with region control and metadata output. Places multiple instances of a shape mask within a region mask, with control over count, scale, rotation, and overlap. Outputs both the composite mask and JSON metadata for each placement.
Advanced Shape Placement
- shape_mask
- region_mask
- base_mask
- exclusion_mask
- MASK (all)
- MASK (new)
- JSON
◄count30►
◄scale_min0.060►
◄scale_max0.150►
◄rotation_min-30►
◄rotation_max30►
◄overlap_ratio0.50►
◄coverage_min0.00►
◄exclusion_tolerance0.00►
◄out_of_bounds_tolerance0.00►
◄max_consecutive_fails100►
◄seed0►
◄debug_mode0►
CategoryTJ_PolkaDot
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| shape_mask | MASK | Base shape mask to place multiple times | |
| count | INT | 301–200 | Number of shapes to place |
| scale_min | FLOAT | 0.0600.005–5 | Minimum scale factor |
| scale_max | FLOAT | 0.1500.005–5 | Maximum scale factor |
| rotation_min | FLOAT | -30-180–180 | Minimum rotation angle in degrees |
| rotation_max | FLOAT | 30-180–180 | Maximum rotation angle in degrees |
| overlap_ratio | FLOAT | 0.500–1 | Maximum overlap ratio with existing shapes (0=no overlap, 1=full overlap allowed) |
| coverage_min | FLOAT | 0.000–1 | Minimum coverage ratio in region mask (0.0=any overlap OK, 1.0=must be fully inside region) |
| exclusion_tolerance | FLOAT | 0.000–1 | Maximum allowed intrusion ratio into exclusion zones (0=strict prohibition, 1=full intrusion allowed) |
| out_of_bounds_tolerance | FLOAT | 0.000–1 | Maximum allowed out-of-bounds ratio (0=shapes must be fully inside canvas, 1=shapes can be completely outside) |
| max_consecutive_fails | INT | 10010–1000 | Maximum consecutive failures before early termination (10-1000) |
| seed | INT | 00–4294967295 | Random seed for reproducibility |
| debug_mode | INT | 00–1 | Enable detailed debug output (0=off, 1=on) |
| region_maskopt | MASK | Optional region mask defining where shapes can be placed (if not provided, uses full canvas) | |
| base_maskopt | MASK | Optional base mask to combine with (for chaining multiple placements) | |
| exclusion_maskopt | MASK | Optional exclusion zone mask where shapes should not be placed |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| MASK (all) | MASK | Combined mask with all placed shapes (includes base_mask if provided) |
| MASK (new) | MASK | Only the newly added shapes (excludes base_mask) |
| JSON | STRING | JSON array with position, scale, rotation for each shape |