Files
chflame163-ComfyUI_LayerStyle/py/get_image_size.py
T
chflame163 3bf19861c6 Commit MaskBoxDetect, X,Y to Percent, GaussianBlur and GetImageSize nodes.
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.
2024-01-23 13:39:41 +08:00

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"
}