fixed regex

This commit is contained in:
David Chatel
2025-03-29 07:34:39 +01:00
parent d903936b52
commit a8dd2f0347
+1 -1
View File
@@ -671,7 +671,7 @@ class DavchaEmptyLatentImage:
DESCRIPTION = "Create a new batch of empty latent images to be denoised via sampling."
def generate(self, width, height, option, batch_size=1):
width, height, upscale_factor = re.findall("(\d+)x(\d+): (\d+\.?\d*)", option)[0]
width, height, upscale_factor = re.findall(r"(\d+)x(\d+): (\d+\.?\d*)", option)[0]
width, height, upscale_factor = int(width), int(height), float(upscale_factor)
latent = torch.zeros([batch_size, 4, height // 8, width // 8], device=self.device)
return ({"samples":latent}, upscale_factor, batch_size)