Changed to round up to closest 64

This commit is contained in:
pythongosssss
2023-03-09 13:32:15 +00:00
parent 6f76f3b205
commit fd9fc9f7a4
+5 -1
View File
@@ -1,5 +1,5 @@
import comfy.utils
import math
class LatentUpscaleBy:
upscale_methods = ["nearest-exact", "bilinear", "area"]
@@ -18,7 +18,11 @@ class LatentUpscaleBy:
def upscale(self, samples, upscale_method, scale, crop):
s = samples.copy()
w = round(samples["samples"].shape[3] * 8 * scale)
w = 64 * math.ceil(w / 64)
h = round(samples["samples"].shape[2] * 8 * scale)
h = 64 * math.ceil(h / 64)
s["samples"] = comfy.utils.common_upscale(
samples["samples"], w // 8, h // 8, upscale_method, crop)
return (s,)