Commit MaskBoxDetect node, which can automatically detect the position through the mask and output it to the composite node. Commit X,Y to Percent node to convert absolute coordinates to percent coordinates. Commit GaussianBlur node. Commit GetImageSize node.
41 lines
850 B
Python
41 lines
850 B
Python
from .imagefunc import *
|
|
|
|
def process(image:Image) -> Image:
|
|
|
|
return image
|
|
|
|
class GetImageSize:
|
|
|
|
def __init__(self):
|
|
pass
|
|
|
|
@classmethod
|
|
def INPUT_TYPES(self):
|
|
|
|
return {
|
|
"required": {
|
|
"image": ("IMAGE", ),
|
|
},
|
|
"optional": {
|
|
}
|
|
}
|
|
|
|
RETURN_TYPES = ("INT", "INT",)
|
|
RETURN_NAMES = ("width", "height",)
|
|
FUNCTION = 'get_image_size'
|
|
CATEGORY = '😺dzNodes/LayerUtility'
|
|
OUTPUT_NODE = True
|
|
|
|
def get_image_size(self, image,):
|
|
|
|
_image = tensor2pil(image).convert('RGB')
|
|
|
|
return (_image.width, _image.height,)
|
|
|
|
NODE_CLASS_MAPPINGS = {
|
|
"LayerUtility: GetImageSize": GetImageSize
|
|
}
|
|
|
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
|
"LayerUtility: GetImageSize": "LayerUtility: GetImageSize"
|
|
} |