diff --git a/ldm/invoke/generator/txt2img2img.py b/ldm/invoke/generator/txt2img2img.py index 7762d2a51d..759ba2dba4 100644 --- a/ldm/invoke/generator/txt2img2img.py +++ b/ldm/invoke/generator/txt2img2img.py @@ -25,16 +25,15 @@ class Txt2Img2Img(Generator): kwargs are 'width' and 'height' """ uc, c, extra_conditioning_info = conditioning + scale_dim = min(width, height) + scale = 512 / scale_dim + + init_width = math.ceil(scale * width / 64) * 64 + init_height = math.ceil(scale * height / 64) * 64 @torch.no_grad() def make_image(x_T): - scale_dim = min(width, height) - scale = 512 / scale_dim - - init_width = math.ceil(scale * width / 64) * 64 - init_height = math.ceil(scale * height / 64) * 64 - shape = [ self.latent_channels, init_height // self.downsampling_factor,