From 53aa0b25db5107c379d8fbb66444bae8f86d07cc Mon Sep 17 00:00:00 2001 From: chflame163 Date: Fri, 30 Aug 2024 10:30:18 +0800 Subject: [PATCH] fix mask dimension input bug of LAMA node --- py/lama.py | 5 +++-- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/py/lama.py b/py/lama.py index 0f5198f..1a66016 100644 --- a/py/lama.py +++ b/py/lama.py @@ -39,6 +39,7 @@ class LaMa: l_images = [] l_masks = [] ret_images = [] + print(f"########################mask.shape={mask.shape},dim={mask.dim()}") for l in image: l_images.append(torch.unsqueeze(l, 0)) @@ -47,7 +48,7 @@ class LaMa: l_masks.append(m.split()[-1]) if mask is not None: if mask.dim() == 2: - layer_mask = torch.unsqueeze(mask, 0) + mask = torch.unsqueeze(mask, 0) l_masks = [] for m in mask: if invert_mask: @@ -106,7 +107,7 @@ class LaMa: log(f"Error: {NODE_NAME} skipped, because unable to create temporary file.", message_type='error') return (image, ) file_name_list.append(file_name) - # process + # process from .iopaint import cli cli.run(model=lama_model, device=device, image=Path(image_dir), mask=Path(mask_dir), output=Path(result_dir), config=Path(config_dir)) ret_images = [pil2tensor(check_image_file(os.path.join(result_dir, file_name), 500)) for file_name in file_name_list] diff --git a/pyproject.toml b/pyproject.toml index 3478845..7bf0c9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui_layerstyle" description = "A set of nodes for ComfyUI it generate image like Adobe Photoshop's Layer Style. the Drop Shadow is first completed node, and follow-up work is in progress." -version = "1.0.36" +version = "1.0.37" license = "MIT" dependencies = ["numpy", "pillow", "torch", "matplotlib", "Scipy", "scikit_image", "opencv-contrib-python", "pymatting", "segment_anything", "timm", "addict", "yapf", "colour-science", "wget", "mediapipe", "loguru", "typer_config", "fastapi", "rich", "google-generativeai", "diffusers", "omegaconf", "tqdm", "transformers", "kornia", "image-reward", "ultralytics", "blend_modes", "blind-watermark", "qrcode", "pyzbar", "transparent-background", "huggingface_hub", "accelerate", "bitsandbytes", "torchscale", "wandb", "hydra-core", "psd-tools"]