diff --git a/modules/processing.py b/modules/processing.py index 52f00bfb922..dc7422c82b5 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -1228,7 +1228,7 @@ def init(self, all_prompts, all_seeds, all_subseeds): if tuple(self.hr_negative_prompt) != tuple(self.negative_prompt): self.extra_generation_params["Hires negative prompt"] = self.hr_negative_prompt - self.latent_scale_mode = shared.latent_upscale_modes.get(self.hr_upscaler, None) if self.hr_upscaler is not None else shared.latent_upscale_modes.get(shared.latent_upscale_default_mode, "nearest") + self.latent_scale_mode = shared.latent_upscale_modes.get(self.hr_upscaler, None) if self.hr_upscaler is not None else shared.latent_upscale_modes.get(shared.latent_upscale_default_mode, "nearest-exact") if self.enable_hr and self.latent_scale_mode is None: if not any(x.name == self.hr_upscaler for x in shared.sd_upscalers): raise Exception(f"could not find upscaler named {self.hr_upscaler}") @@ -1654,7 +1654,7 @@ def init(self, all_prompts, all_seeds, all_subseeds): devices.torch_gc() if self.resize_mode == 3: - self.init_latent = torch.nn.functional.interpolate(self.init_latent, size=(self.height // opt_f, self.width // opt_f), mode="bilinear") + self.init_latent = torch.nn.functional.interpolate(self.init_latent, size=(self.height // opt_f, self.width // opt_f), mode="nearest-exact", antialias=False) if image_mask is not None: init_mask = latent_mask diff --git a/modules/sd_hijack_unet.py b/modules/sd_hijack_unet.py index 2101f1a0415..aa32998c08c 100644 --- a/modules/sd_hijack_unet.py +++ b/modules/sd_hijack_unet.py @@ -24,7 +24,7 @@ def cat(self, tensors, *args, **kwargs): if len(tensors) == 2: a, b = tensors if a.shape[-2:] != b.shape[-2:]: - a = torch.nn.functional.interpolate(a, b.shape[-2:], mode="nearest") + a = torch.nn.functional.interpolate(a, b.shape[-2:], mode="nearest-exact") tensors = (a, b) diff --git a/modules/shared.py b/modules/shared.py index ccdca4e7040..73be86a810c 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -47,7 +47,7 @@ tab_names = [] -latent_upscale_default_mode = "Latent" +latent_upscale_default_mode = "Latent (nearest-exact)" latent_upscale_modes = { "Latent": {"mode": "bilinear", "antialias": False}, "Latent (antialiased)": {"mode": "bilinear", "antialias": True},