ComfyUI > Nodes > ComfyUI Level Pixel > Resize Image and Masks [LP]

ComfyUI Node: Resize Image and Masks [LP]

Class Name

ResizeImageAndMasks|LP

Category
LevelPixel/Image
Author
LevelPixel (Account age: 647days)
Extension
ComfyUI Level Pixel
Latest Updated
2026-02-24
Github Stars
0.03K

How to Install ComfyUI Level Pixel

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

Resize Image and Masks [LP] Description

Resizes images and masks while maintaining proportions and alignment for AI art processing.

Resize Image and Masks [LP]| Resize Image and Masks [LP]:

The ResizeImageAndMasks| Resize Image and Masks [LP] node is designed to facilitate the resizing of images and their associated masks, ensuring that both elements maintain their relative proportions and alignment. This node is particularly beneficial for AI artists who need to prepare images and masks for further processing or analysis, as it allows for precise control over the resizing process. By utilizing efficient algorithms, the node ensures that the resizing operation is both fast and accurate, preserving the quality of the image and the integrity of the mask. The primary goal of this node is to provide a seamless and efficient way to adjust the dimensions of images and masks, making it an essential tool for tasks that require image manipulation and preparation.

Resize Image and Masks [LP]| Resize Image and Masks [LP] Input Parameters:

downscale_algorithm

This parameter specifies the algorithm used to reduce the size of the image and masks. Options include nearest, bilinear, bicubic, lanczos, box, and hamming, with bilinear as the default. The choice of algorithm affects the quality and speed of the downscaling process, with some algorithms providing smoother results while others prioritize speed.

upscale_algorithm

This parameter determines the algorithm used to increase the size of the image and masks. Available options are nearest, bilinear, bicubic, lanczos, box, and hamming, with bicubic as the default. The selected algorithm impacts the clarity and detail of the upscaled image, with some algorithms offering sharper results at the cost of increased processing time.

preresize_mode

This parameter controls the mode of resizing before the main operation, ensuring that the image and masks are within specified dimensions. It helps in maintaining the aspect ratio and preventing distortion during the resizing process.

preresize_min_width

This parameter sets the minimum allowable width for the image and masks before resizing. It ensures that the resized output does not fall below a certain width, preserving the visual integrity of the image.

preresize_min_height

This parameter defines the minimum allowable height for the image and masks before resizing. It ensures that the resized output maintains a minimum height, which is crucial for preserving the aspect ratio and overall appearance.

preresize_max_width

This parameter specifies the maximum allowable width for the image and masks before resizing. It prevents the output from exceeding a certain width, which is important for maintaining consistency across different images.

preresize_max_height

This parameter sets the maximum allowable height for the image and masks before resizing. It ensures that the resized output does not exceed a specified height, helping to maintain uniformity and prevent distortion.

image

This optional parameter represents the image to be resized. If provided, the node will adjust its dimensions according to the specified algorithms and constraints, ensuring that the image is resized efficiently and accurately.

mask

This optional parameter represents the mask associated with the image. If provided, the node will resize the mask in tandem with the image, ensuring that both elements remain aligned and proportional.

optional_context_mask

This optional parameter allows for the inclusion of an additional context mask, which can be resized alongside the image and primary mask. This is useful for scenarios where additional contextual information needs to be preserved during the resizing process.

Resize Image and Masks [LP]| Resize Image and Masks [LP] Output Parameters:

image

The resized image is the primary output of the node, reflecting the adjustments made according to the specified parameters. It maintains the quality and proportions of the original image while fitting within the defined constraints.

mask

The resized mask is output alongside the image, ensuring that it remains aligned and proportional to the resized image. This is crucial for applications where the mask is used for further processing or analysis.

optional_context_mask

If an optional context mask was provided, the node outputs the resized version of this mask. It ensures that any additional contextual information is preserved and remains aligned with the resized image and primary mask.

Resize Image and Masks [LP]| Resize Image and Masks [LP] Usage Tips:

  • Choose the appropriate downscale and upscale algorithms based on the desired balance between speed and quality. For smoother results, consider using bicubic or lanczos.
  • Ensure that the preresize dimensions are set to prevent distortion and maintain the aspect ratio of the image and masks.
  • Utilize the optional context mask parameter when additional contextual information needs to be preserved during resizing.

Resize Image and Masks [LP]| Resize Image and Masks [LP] Common Errors and Solutions:

Internal error: Target width <target_width> is outside the range <preresize_min_width> - <preresize_max_width>

  • Explanation: This error occurs when the target width for resizing is set outside the allowable range defined by preresize_min_width and preresize_max_width.
  • Solution: Adjust the target width to fall within the specified range to resolve this error.

Internal error: Target height <target_height> is outside the range <preresize_min_height> - <preresize_max_height>

  • Explanation: This error indicates that the target height for resizing is outside the allowable range defined by preresize_min_height and preresize_max_height.
  • Solution: Modify the target height to ensure it is within the specified range to fix this issue.

Resize Image and Masks [LP] Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Level Pixel
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.

Resize Image and Masks [LP]