Video Helper Suite πŸŽ₯πŸ…₯πŸ…—πŸ…’/imagegenerated

Get Image Count πŸŽ₯πŸ…₯πŸ…—πŸ…’(GetImageCount)

From a technical implementation perspective, this node receives a PyTorch tensor as input, typically with a shape of `[batch_size, height, width, channels]`.

Get Image Count

images
count
VideoHelperSuite

The Get Image Count πŸŽ₯πŸ…₯πŸ…—πŸ…’ node, from a technical implementation perspective, receives a PyTorch Tensor as input, typically with a shape of [batch_size, height, width, channels].

The Get Image Count node is a utility tool for image sequence processing. Its core function is to receive a batch of images (of type IMAGE) and quickly calculate the total number of images contained within that batch. This node does not modify the image content; it only performs the counting operation and outputs the result as an integer (INT).

Node Functionality

From a technical implementation perspective, this node receives a PyTorch Tensor as input, typically with a shape of [batch_size, height, width, channels]. The node accesses the first dimension of the tensor (i.e., size(0)) to obtain the number of images in the batch. It supports the standard IMAGE data type in ComfyUI and can seamlessly process image sequences output by other image generation or loading nodes.

Node Parameter Description - Get Image Count πŸŽ₯πŸ…₯πŸ…—πŸ…’

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
imagesIMAGEYes--Input parameter images: Receives an IMAGE type image batch. The node will calculate the number of images contained in this batch.

Output

Parameter NameData TypeDescription
countINTOutput parameter count: Outputs an integer value representing the total number of images in the input image batch.

Usage Scenarios

In practical workflows, this node is often used in stages that require dynamic decision-making based on the number of images. For example, in a video frame processing pipeline, this node can first be used to obtain the total number of frames extracted from a video. This value can then be passed to a loop node to control the number of iterations for post-processing (such as upscaling, color grading) on each frame, thereby enabling automated batch operations.

Notes

This node only has requirements for the dimensions of the input data; the input must be a valid, correctly shaped IMAGE tensor. If the input is not a batch of images (e.g., a single image), it will still return 1.

The Get Image Count πŸŽ₯πŸ…₯πŸ…—πŸ…’ node is from the ComfyUI-VideoHelperSuite node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…