KJNodes/imagegenerated

Resize Image (deprecated)(ImageResizeKJ)

This node technically receives an image input in the form of a four-dimensional tensor (batch, height, width, channels) and applies a selected interpolation method (such as bilinear, Lanczos, etc.) for size transformation.

Image Resize KJ

image
get_image_size
IMAGE
width
height
width
INT
height
INT
upscale_method
COMBO
keep_proportion
divisible_by
2
crop
COMBO
KJNodes

Deprecated: This node should no longer be used due to ComfyUI frontend changes; please use the v2 version. It is kept only for backward compatibility with older workflows.

The Resize Image (deprecated) node technically receives an image input in the form of a four-dimensional tensor (batch, height, width, channels) and applies a selected interpolation method (such as bilinear, Lanczos, etc.) for size transformation.

The Resize Image (deprecated) node is a tool for adjusting image dimensions. Its core function is to receive an input image and change its resolution based on user-specified width, height, or other rules. This node supports multiple upsampling algorithms and can handle common requirements such as maintaining aspect ratio and automatic cropping.

Node Function

This node technically receives an image input in the form of a four-dimensional tensor (batch, height, width, channels) and applies a selected interpolation method (such as bilinear, Lanczos, etc.) for size transformation. It supports obtaining target dimensions from other images and can adjust the output dimensions to integer multiples of a specified number to meet special input size requirements of certain models. The node's internal logic prioritizes externally passed dimension parameters.

Node Parameter Description - Resize Image (deprecated)

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
imageIMAGEYes--image (Input Parameter): The source image that needs resizing. This is the primary object processed by the node.
upscale_methodCOMBOYes--upscale_method (Input Parameter): Selects the interpolation algorithm used for image upscaling, such as "lanczos" or "bicubic", affecting the quality of the scaled image.
get_image_sizeIMAGENo--get_image_size (Input Parameter): Connect another image; the node will automatically use that image's dimensions as the target width and height for this adjustment.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
widthINTYes5120 - MAX_RESOLUTION (Step: 1)width (Input Parameter): The target width value for the output image.
heightINTYes5120 - MAX_RESOLUTION (Step: 1)height (Input Parameter): The target height value for the output image.
keep_proportionBOOLEANYesFalse-keep_proportion (Input Parameter): Boolean switch. When enabled, it automatically calculates the other dimension based on the target width or height while maintaining the original image's aspect ratio.
divisible_byINTYes20 - 512 (Step: 1)divisible_by (Input Parameter): Adjusts the final output dimensions to be an integer multiple of this value. Range 0-512, step 1. Often used to meet model alignment requirements.
cropCOMBONo-"disabled", "center", "0"-

Output

Parameter NameData TypeDescription
IMAGEIMAGEIMAGE (Output Parameter): Outputs the image after dimension adjustment.
widthINTwidth (Output Parameter): The actual width value of the final generated output image.
heightINTheight (Output Parameter): The actual height value of the final generated output image.

Usage Scenarios

In a typical image preprocessing workflow, you can connect this node after the image loading node to uniformly scale raw images of various sizes to the input dimensions expected by models (such as Stable Diffusion). For example, when building text-to-image or image-to-image workflows, it ensures the input image dimensions comply with the specifications of subsequent VAE or UNet models.

Notes

Deprecated! Due to ComfyUI frontend changes, this node should no longer be used. Please use the v2 version. This node is only kept to not completely break older workflows.

The Resize Image (deprecated) node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…