KJNodes/imagegenerated

Get Image Size & Count(GetImageSizeAndCount)

This node receives a tensor of type IMAGE as input and analyzes its shape.

Get Image Size And Count

image
image
width
height
count
KJNodes

The Get Image Size & Count node receives a tensor of type IMAGE as input and analyzes its shape.

The Get Image Size & Count node is an image information extraction tool. It reads the dimensions and batch information of the input image and passes the original image data through unchanged. This node is primarily used to obtain basic metadata of an image, facilitating dynamic adjustments by subsequent nodes based on this information.

Node Functionality

This node receives a tensor of type IMAGE as input and analyzes its shape. It extracts the width, height, and batch count (i.e., the size of the first dimension of the image tensor, typically representing the number of images) from the tensor's dimensions. This information is output as integers. The node's internal processing does not modify the image data itself.

Node Parameter Description - Get Image Size & Count

Inputs

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
imageIMAGEYes--image (Output Parameter): The image tensor output unchanged, with its content unaltered.

Outputs

Parameter NameData TypeDescription
imageIMAGEimage (Output Parameter): The image tensor output unchanged, with its content unaltered.
widthINTwidth (Output Parameter): Outputs the pixel width of the input image.
heightINTheight (Output Parameter): Outputs the pixel height of the input image.
countINTcount (Output Parameter): Outputs the batch size (number of images) of the input image tensor.

Usage Scenarios

This node is very useful in workflows where processing parameters need to be dynamically adjusted based on the actual image dimensions. For example, its width and height outputs can be connected to the size parameters of other image processing nodes to achieve adaptive scaling or cropping, ensuring the processing logic matches the actual size of the input image.

The Get Image Size & Count node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…