ComfyUI > Nodes > ComfyUI-Addoor > Image Resize

ComfyUI Node: Image Resize

Class Name

ImageResize

Category
🌻 Addoor/image
Author
ADDOOR (Account age: 2884days)
Extension
ComfyUI-Addoor
Latest Updated
2025-01-24
Github Stars
0.03K

How to Install ComfyUI-Addoor

Install this extension via the ComfyUI Manager by searching for ComfyUI-Addoor
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Addoor 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

Image Resize Description

Adjust image dimensions while maintaining quality, aspect ratio, and offering upscaling/downscaling with advanced interpolation methods.

Image Resize:

The ImageResize node is designed to adjust the dimensions of an image while maintaining its quality and aspect ratio. This node is particularly useful for AI artists who need to prepare images for various applications, ensuring that the images fit specific size requirements without distortion. The node offers flexibility in resizing by allowing both upscaling and downscaling, depending on the desired output size. It uses advanced interpolation methods, such as bicubic interpolation, to ensure smooth transitions and high-quality results. Additionally, the node can handle padding and cropping, which helps in achieving the exact aspect ratio or dimensions needed for a project. This makes it an essential tool for artists looking to optimize their images for different platforms or creative needs.

Image Resize Input Parameters:

pixels

The pixels parameter represents the image data that you want to resize. It is typically a multi-dimensional array containing pixel values. This parameter is crucial as it forms the basis of the resizing operation, and its quality directly affects the output image.

action

The action parameter determines whether the image will be cropped or padded to achieve the desired aspect ratio. This choice impacts how the image's content is adjusted during resizing, either by removing parts of the image or adding space around it.

smaller_side

The smaller_side parameter specifies the target size for the smaller dimension of the image. This helps in maintaining the aspect ratio while resizing, ensuring that the image does not become distorted.

larger_side

The larger_side parameter sets the target size for the larger dimension of the image. It is used to control the maximum size of the image, which is particularly useful when you want to upscale an image without exceeding a certain size.

scale_factor

The scale_factor parameter is a multiplier that determines how much the image should be scaled. It is automatically calculated based on the desired dimensions and the current size of the image, ensuring that the resizing operation is proportional.

resize_mode

The resize_mode parameter specifies whether the image should be upscaled or downscaled. This choice affects the scale factor and ensures that the image is resized in the intended direction, either increasing or decreasing its size.

side_ratio

The side_ratio parameter defines the aspect ratio that the image should maintain after resizing. This is important for ensuring that the image's proportions remain consistent, which is crucial for aesthetic and functional purposes.

crop_pad_position

The crop_pad_position parameter determines the position where cropping or padding should occur. This affects how the image is adjusted spatially, allowing for control over which parts of the image are emphasized or minimized.

pad_feathering

The pad_feathering parameter controls the smoothness of the padding edges. This is useful for creating a more natural transition between the image and the padded areas, enhancing the overall visual quality.

mask_optional

The mask_optional parameter is an optional input that allows you to provide a mask for the image. This mask can be used to specify areas of the image that should be preserved or altered during the resizing process, offering additional control over the final output.

Image Resize Output Parameters:

pixels

The pixels output parameter provides the resized image data. This is the main result of the node's operation, reflecting the changes made according to the specified input parameters. The quality and dimensions of this output are directly influenced by the node's configuration.

mask

The mask output parameter returns the adjusted mask, if one was provided. This output is useful for further processing or analysis, as it reflects any changes made to the mask during the resizing operation.

Image Resize Usage Tips:

  • To maintain the highest quality, use the bicubic interpolation mode, which provides smooth transitions and reduces artifacts.
  • When resizing for specific platforms, ensure that the side_ratio matches the platform's requirements to avoid distortion.

Image Resize Common Errors and Solutions:

Invalid input parameters

  • Explanation: This error occurs when one or more input parameters are not set correctly, such as providing a negative value for smaller_side or larger_side.
  • Solution: Double-check all input parameters to ensure they are within valid ranges and correctly configured.

Mask dimension mismatch

  • Explanation: This error happens when the provided mask does not match the dimensions of the input image.
  • Solution: Ensure that the mask dimensions align with the image dimensions or allow the node to automatically adjust the mask size.

Image Resize Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Addoor
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 Playground, enabling artists to harness the latest AI tools to create incredible art.