diff --git a/py/inc/lib/image.py b/py/inc/lib/image.py index 719968a..f583401 100644 --- a/py/inc/lib/image.py +++ b/py/inc/lib/image.py @@ -132,10 +132,6 @@ def get_tiled_grid_specs(self, image, tile_size, rows_qty = 3, cols_qty = 3, siz tile_height = height tile_width_units_qty = math.ceil(tile_width / size_unit) tile_height_units_qty = math.ceil(tile_height / size_unit) - new_width = tile_size * cols_qty - new_height = tile_size * rows_qty - last_tile_width_diff = new_width - image.shape[2] - last_tile_height_diff = new_height - image.shape[1] tile_order_rows = MS_Array.reorder_edges_to_center(list(range(rows_qty))) tile_order_cols = MS_Array.reorder_edges_to_center(list(range(cols_qty))) @@ -156,6 +152,8 @@ def get_tiled_grid_specs(self, image, tile_size, rows_qty = 3, cols_qty = 3, siz x = image.shape[2] - _tile_width else: x = x_tile_coordinate - (1 * feather_size) + if x + _tile_width > image.shape[2]: + x = x - ((x + _tile_width) - image.shape[2]) # if first or last height tile if row_index == 0: @@ -164,6 +162,8 @@ def get_tiled_grid_specs(self, image, tile_size, rows_qty = 3, cols_qty = 3, siz y = image.shape[1] - _tile_height else: y = y_tile_coordinate - (1 * feather_size) + if y + _tile_height > image.shape[1]: + y = y - ((y + _tile_height) - image.shape[1]) tiles.append([ row_index, diff --git a/py/nodes/UpscalerRefiner/McBoaty_v3.py b/py/nodes/UpscalerRefiner/McBoaty_v3.py index 3bc2c52..d995a8d 100644 --- a/py/nodes/UpscalerRefiner/McBoaty_v3.py +++ b/py/nodes/UpscalerRefiner/McBoaty_v3.py @@ -292,7 +292,10 @@ def upscale_refine(self, image, iteration): # grid_specs = MS_Image().get_dynamic_grid_specs(upscaled_image.shape[2], upscaled_image.shape[1], rows_qty, cols_qty, feather_mask)[0] grid_specs = MS_Image().get_tiled_grid_specs(upscaled_image, self.KSAMPLER.tile_size, rows_qty, cols_qty, feather_mask)[0] + log(grid_specs) grid_images = MS_Image().get_grid_images(upscaled_image, grid_specs) + for grid_image in grid_images: + log(grid_image.shape) grid_prompts = ["No tile prompting"] grid_latents = []