diff --git a/py/extand_canvas_v2.py b/py/extand_canvas_v2.py index a14c232..19b55b2 100644 --- a/py/extand_canvas_v2.py +++ b/py/extand_canvas_v2.py @@ -14,10 +14,10 @@ class ExtendCanvasV2: "required": { "image": ("IMAGE", ), "invert_mask": ("BOOLEAN", {"default": True}), # 反转mask - "top": ("INT", {"default": 0, "min": 0, "max": 99999, "step": 1}), - "bottom": ("INT", {"default": 0, "min": 0, "max": 99999, "step": 1}), - "left": ("INT", {"default": 0, "min": 0, "max": 99999, "step": 1}), - "right": ("INT", {"default": 0, "min": 0, "max": 99999, "step": 1}), + "top": ("INT", {"default": 0, "min": -99999, "max": 99999, "step": 1}), + "bottom": ("INT", {"default": 0, "min": -99999, "max": 99999, "step": 1}), + "left": ("INT", {"default": 0, "min": -99999, "max": 99999, "step": 1}), + "right": ("INT", {"default": 0, "min": -99999, "max": 99999, "step": 1}), "color": ("STRING", {"default": "#000000"}), }, "optional": { @@ -67,6 +67,11 @@ class ExtendCanvasV2: width = _image.width + left + right height = _image.height + top + bottom + if width < 1: + width = 1 + if height < 1: + height = 1 + _canvas = Image.new('RGB', (width, height), color) _mask_canvas = Image.new('L', (width, height), "black") diff --git a/pyproject.toml b/pyproject.toml index 3f825b8..8568141 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.43" +version = "1.0.44" 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", "inference-cli[yolo-world]", "inference-gpu[yolo-world]", "onnxruntime"]