Commit GetColorTone, MaskGrow and MaskEdgeShink nodes.

Commit GetColorTone node, can obtain the main color or average color of the image. 
Commit MaskGrow and MaskEdgeShink node.
This commit is contained in:
chflame163
2024-01-24 20:38:44 +08:00
committed by GitHub
parent 8fb316595b
commit 7ff4f8ee10
16 changed files with 362 additions and 31 deletions
+41
View File
@@ -0,0 +1,41 @@
from .imagefunc import *
class GradientImage:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(self):
return {
"required": {
"width": ("INT", {"default": 512, "min": 4, "max": 99999, "step": 1}),
"height": ("INT", {"default": 512, "min": 4, "max": 99999, "step": 1}),
"angle": ("INT", {"default": 0, "min": -360, "max": 360, "step": 1}),
"start_color": ("STRING", {"default": "#FFFFFF"},),
"end_color": ("STRING", {"default": "#000000"},),
},
"optional": {
}
}
RETURN_TYPES = ("IMAGE", )
RETURN_NAMES = ("image", )
FUNCTION = 'gradient_image'
CATEGORY = '😺dzNodes/LayerUtility'
OUTPUT_NODE = True
def gradient_image(self, width, height, angle, start_color, end_color, ):
ret_image = gradint(start_color, end_color, width, height, angle)
return (pil2tensor(ret_image), )
NODE_CLASS_MAPPINGS = {
"LayerUtility: GradientImage": GradientImage
}
NODE_DISPLAY_NAME_MAPPINGS = {
"LayerUtility: GradientImage": "LayerUtility: GradientImage"
}