From 7c0b2da21ce70d707fb16b8223bfb5470ce63801 Mon Sep 17 00:00:00 2001 From: LaVie024 <62406970+LaVie024@users.noreply.github.com> Date: Mon, 21 Apr 2025 00:30:04 +0000 Subject: [PATCH] Update misc.py Added resolution multiplier to SDXLEmptyLatentSizePicker --- misc.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/misc.py b/misc.py index 9a0670e..ce1eb9e 100644 --- a/misc.py +++ b/misc.py @@ -472,17 +472,21 @@ def INPUT_TYPES(s): "batch_size": ("INT", {"default": 1, "min": 1, "max": 4096}), "width_override": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}), "height_override": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}), + "resolution_multiplier": ("FLOAT", {"default": 1, "min": 0, "max": 100, "step": 0.5}), }} RETURN_TYPES = ("LATENT","INT","INT",) RETURN_NAMES = ("LATENT","width","height",) - FUNCTION = "execute" - CATEGORY = "essentials/utilities" + FUNCTION = "execute" + CATEGORY = "essentials/utilities" - def execute(self, resolution, batch_size, width_override=0, height_override=0): + def execute(self, resolution, batch_size, width_override=0, height_override=0, resolution_multiplier=1.0): width, height = resolution.split(" ")[0].split("x") - width = width_override if width_override > 0 else int(width) - height = height_override if height_override > 0 else int(height) + width = width_override if width_override > 0 else int(width) + height = height_override if height_override > 0 else int(height) + + width = int(resolution_multiplier * width) + height = int(resolution_multiplier * height) latent = torch.zeros([batch_size, 4, height // 8, width // 8], device=self.device) @@ -571,4 +575,4 @@ def tensorShape(tensor): "SimpleMathPercent+": "🔧 Simple Math Percent", "SimpleMathSlider+": "🔧 Simple Math Slider", "SimpleMathSliderLowRes+": "🔧 Simple Math Slider low-res", -} \ No newline at end of file +}