Run ComfyUI Easily with InstaSD

Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:

  • One-click deployment
  • Any model, any node
  • Powerful GPUs for rapid iteration
Get Started

Available Nodes

RemapImageRange

RemapImageRange Node Documentation

Overview

The RemapImageRange node is a part of the ComfyUI-KJNodes collection, designed to process images by remapping their pixel values to a specified range. This functionality is useful in various image processing tasks where adjusting the pixel intensity values is required to meet specific criteria or to prepare images for further manipulation.

Functionality

The core function of the RemapImageRange node is to adjust the range of pixel values in an image. By default, pixel values in an image are typically normalized between 0 and 1. This node allows you to specify a new range for these values, whether you need to expand or compress them. Additionally, it provides an option to clamp the values to ensure they remain within the specified bounds, preventing any unexpected behavior from out-of-range values.

Inputs

The RemapImageRange node accepts the following inputs:

  1. Image: The node takes an image input with pixel values typically normalized between 0 and 1. This image can be in any color format supported by ComfyUI.

  2. Min: A floating-point value specifying the new minimum value to which the image's pixel values should be remapped. The default is 0.0, but it can be adjusted to any value within the range of -10.0 to 1.0.

  3. Max: A floating-point value specifying the new maximum value for the image's pixel values. The default is 1.0, and it can be set to any value between 0.0 and 10.0.

  4. Clamp: A boolean option that indicates whether the image's pixel values should be clamped to the new range. When enabled, all values below the minimum are set to the minimum, and all values above the maximum are set to the maximum.

Outputs

The RemapImageRange node provides a single output:

  • Image: The output is the processed image with new pixel values remapped to the specified range. If clamping is enabled, all values will be within the specified min and max bounds.

Use in ComfyUI Workflows

In ComfyUI workflows, the RemapImageRange node can be employed in various scenarios:

  • Preprocessing: When preparing images for a model that requires input within a specific range, this node ensures that all images meet the necessary criteria.

  • Postprocessing: After image transformations or generation, use this node to adjust the output to desired intensity levels for better visualization or further processing.

  • Normalization: Standardize images from different sources with varying intensity distributions to a common scale, improving consistency in subsequent analysis or visualization steps.

Special Features and Considerations

  • Customizable Range: The node provides flexibility to define both lower and upper bounds, allowing for a wide range of transformations.

  • Clamping Option: The boolean clamp input enables filtering of out-of-bounds values, which is particularly useful for maintaining data integrity when working with sensitive models or pipelines.

  • Seamless Integration: Being part of the ComfyUI-KJNodes, the node benefits from easy integration into existing workflows and compatibility with other nodes within the ecosystem.

Conclusion

The RemapImageRange node is a versatile tool in the ComfyUI suite for image value manipulation. Its ability to precisely control pixel value ranges makes it an essential component for users looking to optimize images for various applications within the ComfyUI environment.