Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-Zlycoris > 🔧 Get Image Size Plus

ComfyUI Node: 🔧 Get Image Size Plus

Class Name

GetImageSizePlus+

Category
essentials_mb/image utils
Author
tripleheadedmonkey (Account age: 1734days)
Extension
ComfyUI-Zlycoris
Latest Updated
2026-02-27
Github Stars
0.0K

How to Install ComfyUI-Zlycoris

Install this extension via the ComfyUI Manager by searching for ComfyUI-Zlycoris
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Zlycoris in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

🔧 Get Image Size Plus Description

Reads image dimensions and batch count, and suggests proportional sizes for a target pixel area.

🔧 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_target at False when you only need to inspect an image’s current dimensions and batch count.
  • Turn calculate_from_target on when you want dimensions with approximately the pixel area of target_width × target_height while retaining the source image’s proportions. For example, a wide image can produce a width greater than target_width and a height less than target_height; the two target values define an area, not fixed output dimensions.
  • Choose multiple_of to suit the requirements of the node receiving the suggested dimensions. Use None when 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 IMAGE connection 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 image and confirm that it supplies a valid image.

IndexError: tuple index out of range

  • Explanation: The node reads image.shape[0], image.shape[1], and image.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 IMAGE output rather than a differently shaped tensor or an incompatible data type.

ZeroDivisionError: division by zero

  • Explanation: When calculate_from_target is 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 is 0. A small calculated dimension can also round to 0 when a numeric multiple_of is 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 None or 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_target set to False, the node returns the original image dimensions and does not use target_width, target_height, or multiple_of.
  • Solution: Turn calculate_from_target on, then review the returned width and height.

🔧 Get Image Size Plus Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Zlycoris
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

🔧 Get Image Size Plus