Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions comfy_extras/nodes_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ def INPUT_TYPES(s):
}
}

RETURN_TYPES = (IO.INT, IO.INT)
RETURN_NAMES = ("width", "height")
RETURN_TYPES = (IO.INT, IO.INT, IO.INT)
RETURN_NAMES = ("width", "height", "batch_size")
FUNCTION = "get_size"

CATEGORY = "image"
Expand All @@ -515,12 +515,13 @@ def INPUT_TYPES(s):
def get_size(self, image, unique_id=None) -> tuple[int, int]:
height = image.shape[1]
width = image.shape[2]
batch_size = image.shape[0]

# Send progress text to display size on the node
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 = {
"ImageCrop": ImageCrop,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
comfyui-frontend-package==1.21.6
comfyui-frontend-package==1.21.7
comfyui-workflow-templates==0.1.25
comfyui-embedded-docs==0.2.0
torch
Expand Down
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ async def send_image(self, image_data, sid=None):
if hasattr(Image, 'Resampling'):
resampling = Image.Resampling.BILINEAR
else:
resampling = Image.ANTIALIAS
resampling = Image.Resampling.LANCZOS

image = ImageOps.contain(image, (max_size, max_size), resampling)
type_num = 1
Expand Down
Loading