Add batch to GetImageSize node. (#8419)

This commit is contained in:
comfyanonymous 2025-06-04 06:40:21 -07:00 committed by GitHub
parent fcc1643c52
commit 871749c208
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -505,8 +505,8 @@ class GetImageSize:
} }
} }
RETURN_TYPES = (IO.INT, IO.INT) RETURN_TYPES = (IO.INT, IO.INT, IO.INT)
RETURN_NAMES = ("width", "height") RETURN_NAMES = ("width", "height", "batch_size")
FUNCTION = "get_size" FUNCTION = "get_size"
CATEGORY = "image" CATEGORY = "image"
@ -515,12 +515,13 @@ class GetImageSize:
def get_size(self, image, unique_id=None) -> tuple[int, int]: def get_size(self, image, unique_id=None) -> tuple[int, int]:
height = image.shape[1] height = image.shape[1]
width = image.shape[2] width = image.shape[2]
batch_size = image.shape[0]
# Send progress text to display size on the node # Send progress text to display size on the node
if unique_id: if unique_id:
PromptServer.instance.send_progress_text(f"width: {width}, height: {height}", unique_id) PromptServer.instance.send_progress_text(f"width: {width}, height: {height}\n batch size: {batch_size}", unique_id)
return width, height return width, height, batch_size
NODE_CLASS_MAPPINGS = { NODE_CLASS_MAPPINGS = {
"ImageCrop": ImageCrop, "ImageCrop": ImageCrop,