mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-10 21:34:43 +08:00
Merge branch 'main' of https://github.com/kijai/ComfyUI-KJNodes
This commit is contained in:
commit
68471f65b3
@ -1195,10 +1195,9 @@ Resizes the mask or batch of masks to the specified width and height.
|
|||||||
ratio = min(width / ow, height / oh)
|
ratio = min(width / ow, height / oh)
|
||||||
width = round(ow*ratio)
|
width = round(ow*ratio)
|
||||||
height = round(oh*ratio)
|
height = round(oh*ratio)
|
||||||
|
outputs = mask.unsqueeze(1)
|
||||||
outputs = mask.unsqueeze(0) # Add an extra dimension for batch size
|
|
||||||
outputs = F.interpolate(outputs, size=(height, width), mode="nearest")
|
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],)
|
return(outputs, outputs.shape[2], outputs.shape[1],)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user