Files
ComfyUI-SelVA/nodes
Ethanfel c9550ce693 experiment: add crop_rect option — rect bbox crop without squarification
crop_rect crops frames to a rectangle around the mask bounding box
(with margin applied independently on each axis) before resizing.
The model still stretches the result to 384×384 / 224×224, but only
sees the region around the target element — simpler than crop_to_mask.

- Refactored _compute_mask_bbox with square= param (True = existing
  square logic, False = rect with per-axis margin)
- Empty mask fallback for rect mode returns the full frame (no-op)
- crop_to_mask takes priority over crop_rect when both are enabled
- crop_margin is shared between both crop modes
- Hash includes crop_rect; crop_margin hashed when either crop is active
- Log line reports mode (square/rect) alongside bbox dimensions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 13:04:46 +02:00
..
2026-04-04 18:04:35 +02:00