From ecee3022f668d371848b2ef6384625460d5d2084 Mon Sep 17 00:00:00 2001 From: RyanOnTheInside <7623207+ryanontheinside@users.noreply.github.com> Date: Sat, 3 May 2025 17:51:37 -0400 Subject: [PATCH] frame count --- node_wrappers/utils/misc_nodes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/node_wrappers/utils/misc_nodes.py b/node_wrappers/utils/misc_nodes.py index 92de1e3..6dc4451 100644 --- a/node_wrappers/utils/misc_nodes.py +++ b/node_wrappers/utils/misc_nodes.py @@ -69,7 +69,8 @@ class FastWebcamCapture: } } - RETURN_TYPES = ("IMAGE",) + RETURN_TYPES = ("IMAGE", "INT") + RETURN_NAMES = ("image", "frame_count") FUNCTION = "process_capture" CATEGORY = "image" @@ -110,7 +111,7 @@ class FastWebcamCapture: # ComfyUI expects BHWC format image_tensor = torch.from_numpy(image_np)[None, ...] - return (image_tensor,) + return (image_tensor, 1) # JSON frames data from sequence capture elif image.startswith("{") and "frames" in image: @@ -164,7 +165,7 @@ class FastWebcamCapture: print(f"Final video tensor shape: {video_tensor.shape}") - return (video_tensor,) + return (video_tensor, len(frames)) except Exception as e: import traceback