EasyUse/Imagegenerated
ImageSize (Side)(imageSizeBySide)
ImageSize (Side) returns the pixel length of either the longer or shorter side of an input image.
image Size By Side
image
resolution
side
COMBO
Easy Use
ImageSize (Side) returns the pixel length of either the longer or shorter side of an input image. This is useful when you need a single integer dimension for downstream operations such as resizing, conditioning area setup, or arithmetic on image measurements. The node is placed in the EasyUse/Image category.
Inputs
- image (
IMAGE, required): An image tensor in ComfyUI's standard format. The node reads the spatial height and width from the tensor to determine the side lengths. - side (
COMBO, required): Which dimension to return:Longest— returns the larger of the image height and width.Shortest— returns the smaller of the image height and width.
Outputs
- INT: The selected side length, in pixels.
Usage Notes
- Use
Longestwhen the dominant/outer dimension is the value you need, such as keeping the larger edge fixed during a resize. - Use
Shortestwhen the limiting dimension matters, such as fitting an image inside a bounded area. - If the image is square, both
LongestandShortestreturn the same value. - The output is a single integer value, so it can be connected directly to any node that expects an integer input.
Comments
Sign in with GitHub to join the discussion.