Visit ComfyUI Online for ready-to-use ComfyUI environment
Adjust image dimensions with precision, flexibility, upscaling, downscaling, crop, pad, and fine-tuning options.
The ImageResize
node is designed to help you adjust the dimensions of your images with precision and flexibility. Whether you need to resize, crop, or pad your images to fit specific dimensions or aspect ratios, this node provides a comprehensive set of tools to achieve your goals. It supports both upscaling and downscaling, ensuring that your images maintain their quality regardless of the size adjustments. The node also allows for fine-tuning through parameters like crop and pad positions, making it ideal for preparing images for various applications, from digital art to machine learning datasets.
This parameter represents the input image that you want to resize. It is required and should be provided in the form of an image tensor.
This parameter determines the type of action to be performed on the image. The available options are resize only
, crop to ratio
, and pad to ratio
. The default action is resize only
.
This parameter sets the target size for the smaller side of the image. It accepts integer values ranging from 0 to 8192, with a default value of 0. Setting this parameter helps maintain the aspect ratio while resizing.
This parameter sets the target size for the larger side of the image. It accepts integer values ranging from 0 to 8192, with a default value of 0. This is useful for ensuring that the image does not exceed a specific dimension.
This parameter allows you to manually set a scaling factor for resizing the image. It accepts float values ranging from 0.0 to 10.0, with a default value of 0.0. This parameter is particularly useful when you need precise control over the scaling process.
This parameter specifies the mode of resizing. The available options are reduce size only
, increase size only
, and any
. This allows you to control whether the image should only be downscaled, upscaled, or resized in any direction.
This parameter sets the target aspect ratio for cropping or padding. It accepts a string in the format width:height
, with a default value of 4:3
. This is useful for ensuring that the image fits a specific aspect ratio.
This parameter determines the position for cropping or padding. It accepts float values ranging from 0.0 to 1.0, with a default value of 0.5. This allows you to control the alignment of the crop or pad operation.
This parameter sets the amount of feathering to apply when padding the image. It accepts integer values ranging from 0 to 8192, with a default value of 20. Feathering helps to blend the padded areas smoothly with the original image.
This optional parameter allows you to provide a mask for the image. If not provided, a default mask of zeros will be used. The mask should be in the form of a tensor and should match the dimensions of the input image.
This output parameter represents the resized image. It is the main result of the node's operation and will be in the form of an image tensor.
This output parameter represents the mask associated with the resized image. It is useful for applications that require both the image and its mask, such as segmentation tasks.
smaller_side
or larger_side
parameter and leave the other at its default value.crop_pad_position
parameter to control the alignment of the crop or pad operation, especially when dealing with images that need to fit specific aspect ratios.increase size only
option in the resize_mode
parameter to ensure that the image quality is preserved.pad_feathering
parameter to smoothly blend padded areas with the original image, which is particularly useful for creating seamless backgrounds.smaller_side
, larger_side
, scale_factor
, and other parameters.smaller_side
, larger_side
, or scale_factor
parameters to ensure that the scale factor falls within the acceptable range for the chosen resize_mode
.© Copyright 2024 RunComfy. All Rights Reserved.