ExtandCanvasV2 support negative value

This commit is contained in:
chflame163
2024-09-04 22:16:13 +08:00
parent 03376bf302
commit ac07d6032a
2 changed files with 10 additions and 5 deletions
+9 -4
View File
@@ -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")
+1 -1
View File
@@ -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"]