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
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 Name | Data Type | Required | Default Value | Value Range/Options | Description |
|---|---|---|---|---|---|
images | IMAGE | Yes | - | - | Input parameter images: Receives an IMAGE type image batch. The node will calculate the number of images contained in this batch. |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| count | INT | Output 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.
Get Image Count π₯π ₯π π ’ Node Source Code Link
The Get Image Count π₯π ₯π π ’ node is from the ComfyUI-VideoHelperSuite node package.
Comments
Sign in with GitHub to join the discussion.