From 8d77ede8954770d80a584d635d5c53bb5e9ba3b8 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Sun, 31 Mar 2024 23:45:26 +0300 Subject: [PATCH] Skip VAE with latent upscale --- modules/processing_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/processing_helpers.py b/modules/processing_helpers.py index a334e2da6..f569a7d35 100644 --- a/modules/processing_helpers.py +++ b/modules/processing_helpers.py @@ -355,7 +355,7 @@ def resize_init_images(p): return p.width, p.height -def resize_hires(p, latents): # input=latents output=pil +def resize_hires(p, latents): # input=latents output=pil if not latent_upscaler else latent if not torch.is_tensor(latents): shared.log.warning('Hires: input is not tensor') first_pass_images = processing_vae.vae_decode(latents=latents, model=shared.sd_model, full_quality=p.full_quality, output_type='pil') @@ -363,7 +363,7 @@ def resize_hires(p, latents): # input=latents output=pil latent_upscaler = shared.latent_upscale_modes.get(p.hr_upscaler, None) # shared.log.info(f'Hires: upscaler={p.hr_upscaler} width={p.hr_upscale_to_x} height={p.hr_upscale_to_y} images={latents.shape[0]}') if latent_upscaler is not None: - latents = torch.nn.functional.interpolate(latents, size=(p.hr_upscale_to_y // 8, p.hr_upscale_to_x // 8), mode=latent_upscaler["mode"], antialias=latent_upscaler["antialias"]) + return torch.nn.functional.interpolate(latents, size=(p.hr_upscale_to_y // 8, p.hr_upscale_to_x // 8), mode=latent_upscaler["mode"], antialias=latent_upscaler["antialias"]) first_pass_images = processing_vae.vae_decode(latents=latents, model=shared.sd_model, full_quality=p.full_quality, output_type='pil') resized_images = [] for img in first_pass_images: