ComfyUI > Nodes > tri3d-comfyui-nodes > Rescale the layer to have given max and min values v4.7.3

ComfyUI Node: Rescale the layer to have given max and min values v4.7.3

Class Name

tri3d-simple_rescale_histogram

Category
TRI3D
Author
TRI3D-LC (Account age: 770days)
Extension
tri3d-comfyui-nodes
Latest Updated
2025-05-21
Github Stars
0.03K

How to Install tri3d-comfyui-nodes

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

Rescale the layer to have given max and min values v4.7.3 Description

Adjust image intensity distribution by rescaling histogram to specified range for enhanced visual quality and consistency.

Rescale the layer to have given max and min values v4.7.3:

The tri3d-simple_rescale_histogram node is designed to adjust the intensity distribution of an image layer by rescaling its histogram to fit within specified minimum and maximum values. This process is particularly useful in image processing tasks where you want to enhance the contrast or normalize the brightness levels across different images. By rescaling the histogram, this node ensures that the pixel values are spread more evenly across the desired range, which can improve the visual quality and consistency of the images. This node is beneficial for artists and designers who need to maintain uniformity in image appearance, especially when dealing with multiple images that need to be visually coherent.

Rescale the layer to have given max and min values v4.7.3 Input Parameters:

x

This parameter represents the input image data that you want to rescale. It is typically a 2D array of pixel intensity values. The function of this parameter is to provide the raw data that will be transformed by the rescaling process. The values in this array are expected to be in a format that can be processed by the node, usually as floating-point numbers.

y1

This parameter specifies the minimum value of the rescaled histogram. It determines the lower bound of the intensity range that the output image will have. By setting this value, you control the darkest point in the rescaled image, which can affect the overall contrast and appearance.

y2

This parameter defines the maximum value of the rescaled histogram. It sets the upper bound of the intensity range for the output image. Adjusting this value allows you to control the brightest point in the rescaled image, influencing the image's contrast and brightness.

x1

This parameter indicates the lower limit of the original histogram that you want to map to the new range. It is used to identify the starting point of the intensity values in the input image that will be rescaled. This helps in focusing the rescaling process on a specific portion of the original histogram.

x2

This parameter represents the upper limit of the original histogram that you want to map to the new range. It marks the endpoint of the intensity values in the input image that will be rescaled. By setting this value, you can control which part of the original histogram is stretched or compressed to fit the new range.

Rescale the layer to have given max and min values v4.7.3 Output Parameters:

y

The output parameter y is the rescaled image data, which is a 2D array of pixel intensity values. This array represents the transformed image where the original histogram has been adjusted to fit within the specified minimum and maximum values. The rescaled image will have enhanced contrast and brightness levels, making it more visually appealing and consistent with other images processed in a similar manner.

Rescale the layer to have given max and min values v4.7.3 Usage Tips:

  • Ensure that the input image data is in the correct format and range before applying the rescale operation to achieve the best results.
  • Experiment with different y1 and y2 values to find the optimal contrast and brightness settings for your specific image processing needs.

Rescale the layer to have given max and min values v4.7.3 Common Errors and Solutions:

"ValueError: Input image data is not in the expected format"

  • Explanation: This error occurs when the input image data does not match the expected format or data type required by the node.
  • Solution: Verify that the input image data is a 2D array of floating-point numbers and ensure it is properly pre-processed before passing it to the node.

"RuntimeWarning: Divide by zero encountered in rescale operation"

  • Explanation: This warning is triggered when the difference between x2 and x1 is zero, leading to a division by zero during the rescaling process.
  • Solution: Ensure that x1 and x2 are set to different values to avoid division by zero. Adjust these parameters to cover the desired range of the original histogram.

Rescale the layer to have given max and min values v4.7.3 Related Nodes

Go back to the extension to check out more related nodes.
tri3d-comfyui-nodes
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.