diff --git a/py/nodes/UpscalerRefiner/McBoaty_v5.py b/py/nodes/UpscalerRefiner/McBoaty_v5.py index 13558af..075d0e3 100644 --- a/py/nodes/UpscalerRefiner/McBoaty_v5.py +++ b/py/nodes/UpscalerRefiner/McBoaty_v5.py @@ -510,10 +510,10 @@ def is_valid_index(index, max = 64): def to_computer_index(human_index): return human_index - 1 - _tiles_to_process = None + _tiles_to_process = [] if tiles_to_process == '': - return [] + return _tiles_to_process indexes = tiles_to_process.split(',') @@ -525,6 +525,7 @@ def to_computer_index(human_index): if is_valid_index(start, max) and is_valid_index(end, max): _tiles_to_process.extend(range(to_computer_index(start), to_computer_index(end) + 1)) else: + _tiles_to_process.append(-1) log(f"tiles_to_process is not in valid format '{tiles_to_process}' - Allowed formats : indexes from 1 to {max} or any range like 1-{max}", None, COLORS['YELLOW'], f"Node {self.INFO.id}") else: # Single index @@ -533,13 +534,17 @@ def to_computer_index(human_index): if is_valid_index(index, max): _tiles_to_process.append(to_computer_index(index)) else: + _tiles_to_process.append(-1) log(f"tiles_to_process is not in valid format '{tiles_to_process}' - Allowed formats : indexes from 1 to {max} or any range like 1-{max}", None, COLORS['YELLOW'], f"Node {self.INFO.id}") except ValueError: + _tiles_to_process.append(-1) # Ignore non-integer values pass # Remove duplicates and sort _tiles_to_process = sorted(set(_tiles_to_process)) + if -1 in _tiles_to_process: + _tiles_to_process = [-1] return _tiles_to_process @@ -622,6 +627,10 @@ def refine(self, image, iteration): output = (nodes.VAEDecode().decode(self.KSAMPLER.vae, latent_output)[0].unsqueeze(0))[0] output_images.append(output) + if len(self.PARAMS.tiles_to_process) > 0 and len(self.OUTPUTS.grid_tiles_to_process) == 0: + log("!!! WARNING !!! you are processing specific tiles without a fully refined image, we suggest to pass through a full refiner first", None, COLORS['YELLOW'], f"Node {self.INFO.id} {iteration}") + self.OUTPUTS.grid_tiles_to_process = self.OUTPUTS.grid_images + if len(self.PARAMS.tiles_to_process) > 0: _grid_tiles_to_process = list(self.OUTPUTS.grid_tiles_to_process) for index, output_image in enumerate(output_images): diff --git a/py/utils/version.py b/py/utils/version.py index e774689..9e1bd86 100644 --- a/py/utils/version.py +++ b/py/utils/version.py @@ -3,4 +3,4 @@ # ### -VERSION = "5.0.3" +VERSION = "5.0.4" diff --git a/pyproject.toml b/pyproject.toml index a1f801d..894c925 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui_marascott_nodes" description = "A set of nodes including a universal bus, an Inpainting By Mask and a large Upscaler/Refiner" -version = "5.0.3" +version = "5.0.4" license = "LICENSE" dependencies = ["blend_modes", "numba", "color-matcher", "groq", "opencv-python"]