From d6885f42dd4df34e95e0168affe88b1f4ee3d5a1 Mon Sep 17 00:00:00 2001 From: Chris Tefer Date: Mon, 2 Dec 2024 20:15:32 -0600 Subject: [PATCH] Modified the math so that each of the width/height values are always divisible by 8 --- cfe_nodes.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cfe_nodes.py b/cfe_nodes.py index 7fe40e9..681b032 100644 --- a/cfe_nodes.py +++ b/cfe_nodes.py @@ -21,15 +21,15 @@ class CFE_Aspect_Ratio: "2:3", "3:4", "4:7", + "8:15", "9:7", "9:16", "11:21", "13:18", "13:19", "14:17", - "15:17", "15:16", - "19:10", + "15:17", ],), "megapixel": ([".5 MP (SD1.5)", "1 MP (SDXL)", "2 MP (FLUX)"],), "clip_size": ("FLOAT", { @@ -80,7 +80,12 @@ class CFE_Aspect_Ratio: mp = 512 * 512 clip_width = int(math.sqrt(math.floor(ratio * mp))) - clip_height = int(math.sqrt(math.floor((1.0/ratio) * mp))) + off_by = clip_width % 8 + clip_width -= off_by + + clip_height = int(mp / clip_width) + off_by = clip_height % 8 + clip_height -= off_by latent = torch.zeros([batch_size, 4, clip_height // 8, clip_width // 8], device=self.device)