Add files via upload

This commit is contained in:
Fictiverse
2025-12-26 02:34:05 +01:00
committed by GitHub
parent f72cebea3d
commit f072af3991
+35
View File
@@ -0,0 +1,35 @@
class FV_GetImageHalfSize:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"image": ("IMAGE",),
}
}
RETURN_TYPES = ("INT", "INT")
RETURN_NAMES = ("width", "height")
FUNCTION = "run"
CATEGORY = "Fictiverse/Resize"
def run(self, image):
# image est un batch : (batch, height, width, channels)
first_image = image[0]
height = first_image.shape[0]
width = first_image.shape[1]
if width >= height:
width = width // 2
else:
height = height // 2
return (width, height)
NODE_CLASS_MAPPINGS = {
"FV Get Image Half Size": FV_GetImageHalfSize
}