From a3f78be5c27b9b5a2c292b5a0edf3b65c3dd1121 Mon Sep 17 00:00:00 2001 From: Mihail Karaev Date: Wed, 17 Dec 2025 07:37:46 +0000 Subject: [PATCH] Add 128 divisibility for nabla --- comfy/ldm/kandinsky5/model.py | 4 +--- comfy_extras/nodes_kandinsky5.py | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/comfy/ldm/kandinsky5/model.py b/comfy/ldm/kandinsky5/model.py index ac9352867..f4e02af70 100644 --- a/comfy/ldm/kandinsky5/model.py +++ b/comfy/ldm/kandinsky5/model.py @@ -387,7 +387,7 @@ class Kandinsky5(nn.Module): transformer_options["block_type"] = "double" B, _, T, H, W = x.shape - NABLA_THR = 40 # long (10 sec) generation + NABLA_THR = 31 # long (10 sec) generation if T > NABLA_THR: assert self.patch_size[0] == 1 @@ -481,5 +481,3 @@ class Kandinsky5(nn.Module): self, comfy.patcher_extension.get_all_wrappers(comfy.patcher_extension.WrappersMP.DIFFUSION_MODEL, transformer_options) ).execute(x, timestep, context, y, time_dim_replace=time_dim_replace, transformer_options=transformer_options, **kwargs) - - diff --git a/comfy_extras/nodes_kandinsky5.py b/comfy_extras/nodes_kandinsky5.py index 9cb234be1..aaaf83566 100644 --- a/comfy_extras/nodes_kandinsky5.py +++ b/comfy_extras/nodes_kandinsky5.py @@ -34,6 +34,9 @@ class Kandinsky5ImageToVideo(io.ComfyNode): @classmethod def execute(cls, positive, negative, vae, width, height, length, batch_size, start_image=None) -> io.NodeOutput: + if length > 121: # 10 sec generation, for nabla + height = 128 * round(height / 128) + width = 128 * round(width / 128) latent = torch.zeros([batch_size, 16, ((length - 1) // 4) + 1, height // 8, width // 8], device=comfy.model_management.intermediate_device()) cond_latent_out = {} if start_image is not None: