From cf9474539959bf67a8f923c6d76c54d480f5704d Mon Sep 17 00:00:00 2001 From: Andrey Pavlov Date: Thu, 12 Jan 2023 16:28:13 +0300 Subject: [PATCH] fix tile size to avoid blur --- scripts/ultimate-upscale.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/ultimate-upscale.py b/scripts/ultimate-upscale.py index 69d98bd..81456fe 100644 --- a/scripts/ultimate-upscale.py +++ b/scripts/ultimate-upscale.py @@ -142,8 +142,8 @@ class USDURedraw(): def init_draw(self, p, width, height): p.inpaint_full_res = True p.inpaint_full_res_padding = self.padding - p.width = self.tile_size - p.height = self.tile_size + p.width = math.ceil((self.tile_size+self.padding) / 64) * 64 + p.height = math.ceil((self.tile_size+self.padding) / 64) * 64 mask = Image.new("L", (width, height), "black") draw = ImageDraw.Draw(mask) return mask, draw @@ -238,8 +238,8 @@ class USDUSeamsFix(): def init_draw(self, p): self.initial_info = None - p.width = self.tile_size - p.height = self.tile_size + p.width = math.ceil((self.tile_size+self.padding) / 64) * 64 + p.height = math.ceil((self.tile_size+self.padding) / 64) * 64 def half_tile_process(self, p, image, rows, cols):