fix prepimage pad

This commit is contained in:
matt3o
2024-03-26 14:59:59 +01:00
parent 64eda9be97
commit eb60705e82
+1 -1
View File
@@ -1026,7 +1026,7 @@ class PrepImageForClipVision:
_, oh, ow, _ = image.shape
output = image.permute([0,3,1,2])
if crop_position == "pad":
if crop_position == "pad" and oh != ow:
if oh > ow:
pad = (oh - ow) // 2
pad = (pad, 0, pad, 0)