This commit is contained in:
kijai 2024-06-19 12:05:15 +03:00
parent 97cefb427a
commit 2fb0ee4934
3 changed files with 6 additions and 5 deletions

View File

@ -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]

View File

@ -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)

View File

@ -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 = ""