🔧 Get Image Size Plus+:
GetImageSizePlus+ reads an image’s dimensions and batch size. It can also calculate a suggested width and height that preserve the image’s original proportions while aiming for a chosen total pixel area. This is useful when you want dimensions suited to a particular image-size budget without manually working out the aspect ratio. The node returns numbers only; it does not resize or otherwise change the image. Its calculated dimensions may differ slightly from the intended pixel area or aspect ratio because each dimension is rounded independently.
🔧 Get Image Size Plus+ Input Parameters:
image
The image or image batch whose dimensions the node reads. This is a required IMAGE input with no default value or numeric range. The node reads the width and height of the images and the number of images in the batch. When calculation is enabled, it uses the image’s original width-to-height ratio to determine the suggested dimensions.
target_width
The width used with target_height to define the desired total pixel area when calculate_from_target is enabled. This is an INT with a default of 1024, a minimum of 0, a maximum of MAX_RESOLUTION as defined by the installed node environment, and a step of 1. It is not necessarily the width returned by the node: the node multiplies the two target values, then uses the image’s original proportions to calculate a new width and height. When calculation is disabled, this setting has no effect.
target_height
The height used with target_width to define the desired total pixel area when calculate_from_target is enabled. This is an INT with a default of 1024, a minimum of 0, a maximum of MAX_RESOLUTION as defined by the installed node environment, and a step of 1. It does not independently set the returned height; the image’s original proportions determine how the target area is divided between width and height. When calculation is disabled, this setting has no effect.
calculate_from_target
Controls whether the node calculates suggested dimensions. This is a BOOLEAN with a default of False. At False, the node returns the image’s original width and height, regardless of the target settings. At True, it uses the target pixel area and the image’s original aspect ratio to calculate new dimensions, then rounds them according to multiple_of. The image count is returned in either mode.
multiple_of
Controls how calculated dimensions are rounded when calculate_from_target is True. This is a string option with choices 8, 16, 32, 64, and None; the default is 8. A numeric choice rounds each calculated dimension independently to the nearest multiple of that number. None rounds each dimension to the nearest whole number instead. This setting has no effect when calculation is disabled. Rounding can make the final pixel area or aspect ratio differ slightly from the calculated values, and small calculated dimensions can round to zero.
🔧 Get Image Size Plus+ Output Parameters:
width
An INT representing the image’s original width when calculate_from_target is False, or its calculated and rounded width when the setting is True. You can use this number as a dimension setting elsewhere in your workflow, but the node has not resized the image. Because the calculated width is rounded independently of the height, it may not exactly preserve the original aspect ratio.
height
An INT representing the image’s original height when calculate_from_target is False, or its calculated and rounded height when the setting is True. Together with width, it describes either the current image dimensions or a suggested size based on the target pixel area. It does not indicate that the image itself has been changed.
count
An INT giving the number of images in the input batch. It is read from the image batch and is unaffected by the target dimensions, the calculation toggle, or the rounding choice.
🔧 Get Image Size Plus+ Usage Tips:
- Leave
calculate_from_targetatFalsewhen you only need to inspect an image’s current dimensions and batch count. - Turn
calculate_from_targeton when you want dimensions with approximately the pixel area oftarget_width×target_heightwhile retaining the source image’s proportions. For example, a wide image can produce a width greater thantarget_widthand a height less thantarget_height; the two target values define an area, not fixed output dimensions. - Choose
multiple_ofto suit the requirements of the node receiving the suggested dimensions. UseNonewhen you want whole-number rounding without restricting dimensions to a particular multiple. - Check the returned dimensions before passing them to a resize or generation node. Independent rounding can change the area slightly, and a zero target value or a very small calculated dimension can produce a zero-valued output.
🔧 Get Image Size Plus+ Common Errors and Solutions:
Required input is missing: image
- Explanation: The node needs an
IMAGEconnection to read dimensions or calculate a size. This is a possible input-validation message, not an error string defined in the provided node class. - Solution: Connect an image-producing node to
imageand confirm that it supplies a valid image.
IndexError: tuple index out of range
- Explanation: The node reads
image.shape[0],image.shape[1], andimage.shape[2]. An input that does not have the expected batch, height, and width dimensions can fail when one of those positions is missing. The exact error displayed depends on the input and host environment. - Solution: Connect a standard
IMAGEoutput rather than a differently shaped tensor or an incompatible data type.
ZeroDivisionError: division by zero
- Explanation: When
calculate_from_targetis on, the node divides the image width by its height to find the aspect ratio. An image with a height of zero cannot be used for that calculation. - Solution: Use a valid image with nonzero height. If you only need to inspect an unusual input’s dimensions, turning calculation off avoids this particular division, although downstream nodes may still reject the image.
Calculated width or height is 0
- Explanation: This is a possible result, not an error message from the node. If either target dimension is
0, the target area is0. A small calculated dimension can also round to0when a numericmultiple_ofis selected. A downstream node may then reject the size. - Solution: Set both target dimensions above zero. If rounding is causing the zero, increase the target area or choose
Noneor a smaller multiple, then check the returned values.
Returned dimensions do not match the target dimensions
- Explanation: This is expected when calculation is on: the target width and height specify a total pixel area, while the source image supplies the aspect ratio. Rounding can cause further small differences.
- Solution: Use the returned dimensions when you want to preserve the source proportions at approximately the target area. If you need an exact width and height, set those values directly in the downstream node instead.
Target settings appear to have no effect
- Explanation: With
calculate_from_targetset toFalse, the node returns the original image dimensions and does not usetarget_width,target_height, ormultiple_of. - Solution: Turn
calculate_from_targeton, then review the returned width and height.
