CropByMask and V2 nodes is forced to size in multiples of 8
This commit is contained in:
@@ -65,6 +65,9 @@ class CropByMask:
|
||||
(x, y, width, height) = max_inscribed_rect(bluredmask)
|
||||
else:
|
||||
(x, y, width, height) = mask_area(_mask)
|
||||
|
||||
width = num_round_to_multiple(width, 8)
|
||||
height = num_round_to_multiple(height, 8)
|
||||
log(f"{NODE_NAME}: Box detected. x={x},y={y},width={width},height={height}")
|
||||
canvas_width, canvas_height = tensor2pil(torch.unsqueeze(image[0], 0)).convert('RGB').size
|
||||
x1 = x - left_reserve if x - left_reserve > 0 else 0
|
||||
|
||||
@@ -69,6 +69,10 @@ class CropByMaskV2:
|
||||
(x, y, width, height) = max_inscribed_rect(bluredmask)
|
||||
else:
|
||||
(x, y, width, height) = mask_area(_mask)
|
||||
|
||||
width = num_round_to_multiple(width, 8)
|
||||
height = num_round_to_multiple(height, 8)
|
||||
|
||||
log(f"{NODE_NAME}: Box detected. x={x},y={y},width={width},height={height}")
|
||||
canvas_width, canvas_height = tensor2pil(torch.unsqueeze(image[0], 0)).convert('RGB').size
|
||||
x1 = x - left_reserve if x - left_reserve > 0 else 0
|
||||
|
||||
Reference in New Issue
Block a user