Update mask_nodes.py

This commit is contained in:
Kijai 2024-05-13 15:06:38 +03:00
parent 4812eff6e5
commit b2d5ab3fcd

View File

@ -1130,10 +1130,9 @@ Resizes the mask or batch of masks to the specified width and height.
ratio = min(width / ow, height / oh)
width = round(ow*ratio)
height = round(oh*ratio)
outputs = mask.unsqueeze(0) # Add an extra dimension for batch size
outputs = mask.unsqueeze(1)
outputs = F.interpolate(outputs, size=(height, width), mode="nearest")
outputs = outputs.squeeze(0) # Remove the extra dimension after interpolation
outputs = outputs.squeeze(1)
return(outputs, outputs.shape[2], outputs.shape[1],)