ComfyUI > Nodes > ComfyUI Level Pixel > Cropped Ranged Size Parameters [LP]

ComfyUI Node: Cropped Ranged Size Parameters [LP]

Class Name

CroppedRangedSizeParameters|LP

Category
LevelPixel/Inpaint
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

Cropped Ranged Size Parameters [LP] Description

Resizes images within set dimensions, preserving aspect ratio for precise inpainting tasks.

Cropped Ranged Size Parameters [LP]| Cropped Ranged Size Parameters [LP]:

The CroppedRangedSizeParameters| Cropped Ranged Size Parameters [LP] node is designed to facilitate the resizing of images within specified dimensional constraints, making it an essential tool for AI artists who need to maintain control over the size of their inpainted images. This node allows you to define a range for both width and height, ensuring that the resulting image fits within these boundaries. By calculating the optimal scaling factors based on the provided minimum and maximum dimensions, the node ensures that the resized image maintains its aspect ratio as closely as possible while adhering to the specified size limits. This functionality is particularly beneficial when working with images that need to be resized without distorting their original proportions, providing a balance between flexibility and precision in image processing tasks.

Cropped Ranged Size Parameters [LP]| Cropped Ranged Size Parameters [LP] Input Parameters:

mask

The mask parameter is a crucial input that defines the area of the image to be processed. It is typically a binary mask where the areas to be inpainted or resized are marked. The dimensions of the mask directly influence the scaling calculations, as the node uses the mask's width and height to determine the appropriate scaling factors for the image.

min_width

The min_width parameter specifies the minimum allowable width for the resized image. It ensures that the image does not shrink below this width during processing. This parameter is essential for maintaining a minimum level of detail and resolution in the output image. The value must be less than or equal to max_width.

min_height

The min_height parameter sets the minimum allowable height for the resized image. Similar to min_width, it ensures that the image retains a certain level of detail and resolution by not shrinking below this height. The value must be less than or equal to max_height.

max_width

The max_width parameter defines the maximum allowable width for the resized image. It acts as an upper limit, preventing the image from becoming too large and potentially losing quality or becoming unwieldy. The value must be greater than or equal to min_width.

max_height

The max_height parameter sets the maximum allowable height for the resized image. It ensures that the image does not exceed this height, maintaining manageability and quality. The value must be greater than or equal to min_height.

optional_context_mask

The optional_context_mask parameter is an optional input that can be used to provide additional context for the resizing operation. If provided, it must match the dimensions of the mask. This parameter allows for more complex masking scenarios where additional areas of the image may influence the resizing process.

Cropped Ranged Size Parameters [LP]| Cropped Ranged Size Parameters [LP] Output Parameters:

cropped_size_parameters

The cropped_size_parameters output provides a dictionary containing the calculated target dimensions for the resized image. It includes target_height and target_width, which represent the new dimensions that adhere to the specified range constraints. Additionally, it includes a batch_mode flag, which is set to False, indicating that the resizing operation is intended for a single image rather than a batch. This output is crucial for subsequent processing steps, as it provides the necessary size information to ensure the image is resized correctly.

Cropped Ranged Size Parameters [LP]| Cropped Ranged Size Parameters [LP] Usage Tips:

  • Ensure that the min_width and min_height parameters are set to values that preserve the essential details of your image, especially if the image contains intricate patterns or text.
  • Use the optional_context_mask to refine the resizing process when dealing with complex images that require additional context for accurate resizing.

Cropped Ranged Size Parameters [LP]| Cropped Ranged Size Parameters [LP] Common Errors and Solutions:

"max_width must be greater than or equal to min_width"

  • Explanation: This error occurs when the max_width parameter is set to a value less than min_width.
  • Solution: Adjust the max_width parameter to be equal to or greater than min_width.

"max_height must be greater than or equal to min_height"

  • Explanation: This error is triggered when the max_height parameter is set to a value less than min_height.
  • Solution: Ensure that the max_height parameter is equal to or greater than min_height.

"optional_context_mask dimensions do not match mask dimensions"

  • Explanation: This error indicates that the dimensions of the optional_context_mask do not match those of the mask.
  • Solution: Verify that the optional_context_mask has the same dimensions as the mask and adjust if necessary.

Cropped Ranged Size Parameters [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.

Cropped Ranged Size Parameters [LP]