From 52c1d933b2f5777c6803c75371e711f313969357 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 19 Dec 2024 22:52:37 -0500 Subject: [PATCH] Fix tiled hunyuan video VAE encode issue. Some shapes like 1024x1024 with tile_size 256 and overlap 64 had issues. --- comfy/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/utils.py b/comfy/utils.py index ab1e3cd5..3ddbfd90 100644 --- a/comfy/utils.py +++ b/comfy/utils.py @@ -807,7 +807,7 @@ def tiled_scale_multidim(samples, function, tile=(64, 64), overlap=8, upscale_am upscaled = [] for d in range(dims): - pos = max(0, min(s.shape[d + 2] - (overlap[d] + 1), it[d])) + pos = max(0, min(s.shape[d + 2] - overlap[d], it[d])) l = min(tile[d], s.shape[d + 2] - pos) s_in = s_in.narrow(d + 2, pos, l) upscaled.append(round(get_scale(d, pos)))