From 2fb0ee4934a240ddf75e63bc4f780ac6a61e2ac8 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Wed, 19 Jun 2024 12:05:15 +0300 Subject: [PATCH] registry --- nodes/image_nodes.py | 5 +++-- nodes/mask_nodes.py | 2 +- pyproject.toml | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/nodes/image_nodes.py b/nodes/image_nodes.py index 2d4cd23..c33967e 100644 --- a/nodes/image_nodes.py +++ b/nodes/image_nodes.py @@ -224,6 +224,7 @@ Concatenates the image2 to image1 in the specified direction. image1 = image1.repeat(repeats1, 1, 1, 1) image2 = image2.repeat(repeats2, 1, 1, 1) if match_image_size: + first_image_shape = first_image_shape if first_image_shape is not None else image1.shape image2_resized = image2.movedim(-1,1) image2_resized = common_upscale(image2_resized, first_image_shape[2], first_image_shape[1], "lanczos", "disabled").movedim(1,-1) else: @@ -563,14 +564,14 @@ but allows setting sub-batches for reduced VRAM usage. device = model_management.get_torch_device() upscale_model.to(device) - in_img = images.movedim(-1,-3).to(device) + in_img = images.movedim(-1,-3) steps = in_img.shape[0] pbar = ProgressBar(steps) t = [] for start_idx in range(0, in_img.shape[0], per_batch): - sub_images = upscale_model(in_img[start_idx:start_idx+per_batch]) + sub_images = upscale_model(in_img[start_idx:start_idx+per_batch].to(device)) t.append(sub_images.cpu()) # Calculate the number of images processed in this batch batch_count = sub_images.shape[0] diff --git a/nodes/mask_nodes.py b/nodes/mask_nodes.py index 8d4ae35..52e3a92 100644 --- a/nodes/mask_nodes.py +++ b/nodes/mask_nodes.py @@ -990,7 +990,7 @@ class GrowMaskWithBlur: previous_output = None current_expand = expand for m in growmask: - output = m.numpy() + output = m.numpy().astype(np.float32) for _ in range(abs(round(current_expand))): if current_expand < 0: output = scipy.ndimage.grey_erosion(output, footprint=kernel) diff --git a/pyproject.toml b/pyproject.toml index b97bea7..2146f4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "comfyui-kjnodes" description = "Various quality of life -nodes for ComfyUI, mostly just visual stuff to improve usability." version = "1.0.0" -license = "LICENSE" +license = "GPL-3.0" dependencies = ["librosa", "numpy", "pillow>=10.3.0", "scipy", "color-matcher", "matplotlib", "huggingface_hub"] [project.urls] @@ -10,6 +10,6 @@ Repository = "https://github.com/kijai/ComfyUI-KJNodes" # Used by Comfy Registry https://comfyregistry.org [tool.comfy] -PublisherId = "" +PublisherId = "kijai" DisplayName = "ComfyUI-KJNodes" Icon = ""