From 9208585442ccbcb983cc1db6f8bfe403fc760ab7 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Fri, 30 Aug 2024 13:21:09 +0300 Subject: [PATCH] pad negative if too short --- nodes.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index 1d16a88..dd80567 100644 --- a/nodes.py +++ b/nodes.py @@ -283,6 +283,11 @@ class CogVideoSampler: elif scheduler == "DPM": pipe.scheduler = CogVideoXDPMScheduler.from_pretrained(base_path, subfolder="scheduler") + if negative.shape[1] < positive.shape[1]: + target_length = positive.shape[1] + padding = torch.zeros((negative.shape[0], target_length - negative.shape[1], negative.shape[2]), device=negative.device) + negative = torch.cat((negative, padding), dim=1) + autocastcondition = not pipeline["onediff"] autocast_context = torch.autocast(mm.get_autocast_device(device)) if autocastcondition else nullcontext() with autocast_context: @@ -314,7 +319,7 @@ class CogVideoDecode: return {"required": { "pipeline": ("COGVIDEOPIPE",), "samples": ("LATENT", ), - "enable_vae_tiling": ("BOOLEAN", {"default": False}), + "enable_vae_tiling": ("BOOLEAN", {"default": False, "tooltip": "Drastically reduces memory use but may introduce seams"}), }, "optional": { "tile_sample_min_height": ("INT", {"default": 96, "min": 16, "max": 2048, "step": 8}),