ComfyUI  >  Nodes  >  ComfyUI-Image-Filters >  Remap Range

ComfyUI Node: Remap Range

Class Name

RemapRange

Category
image/filters
Author
spacepxl (Account age: 295 days)
Extension
ComfyUI-Image-Filters
Latest Updated
6/22/2024
Github Stars
0.1K

How to Install ComfyUI-Image-Filters

Install this extension via the ComfyUI Manager by searching for  ComfyUI-Image-Filters
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Image-Filters 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Remap Range Description

Adjust tonal range by remapping pixel values between specified black and white points for contrast enhancement and brightness normalization.

Remap Range:

The RemapRange node is designed to adjust the tonal range of an image by remapping its pixel values between specified black and white points. This node is particularly useful for enhancing the contrast of an image or for normalizing the brightness levels across different images. By setting the black and white points, you can control the minimum and maximum intensity values, effectively stretching or compressing the image's histogram. This process can help in bringing out details in both the shadows and highlights, making the image more visually appealing and balanced.

Remap Range Input Parameters:

image

This parameter represents the input image that you want to process. The image should be in the form of a tensor, which is a multi-dimensional array commonly used in machine learning and image processing tasks. The node will apply the remapping operation to this image based on the specified black and white points.

blackpoint

The blackpoint parameter sets the lower bound of the tonal range. Pixel values below this point will be mapped to 0 (black). This parameter allows you to control the darkest parts of the image. The value should be a float between 0.0 and 1.0, with a default value of 0.0. Adjusting this value can help in enhancing the shadow details of the image.

whitepoint

The whitepoint parameter sets the upper bound of the tonal range. Pixel values above this point will be mapped to 1 (white). This parameter allows you to control the brightest parts of the image. The value should be a float between 0.01 and 1.0, with a default value of 1.0. Adjusting this value can help in enhancing the highlight details of the image.

Remap Range Output Parameters:

image

The output is the processed image with its pixel values remapped according to the specified black and white points. This image will have enhanced contrast and normalized brightness levels, making it more visually balanced. The output is also in the form of a tensor, ready for further processing or display.

Remap Range Usage Tips:

  • To enhance the contrast of a low-contrast image, set the blackpoint slightly above 0.0 and the whitepoint slightly below 1.0.
  • For images with very bright highlights, lowering the whitepoint can help in bringing out details in those areas.
  • If the image appears too dark, raising the blackpoint can help in making the shadow details more visible.

Remap Range Common Errors and Solutions:

ValueError: blackpoint must be less than whitepoint

  • Explanation: This error occurs when the blackpoint value is set equal to or higher than the whitepoint value.
  • Solution: Ensure that the blackpoint is always less than the whitepoint. Adjust the values accordingly to maintain this relationship.

TypeError: image must be a tensor

  • Explanation: This error occurs when the input image is not provided in the form of a tensor.
  • Solution: Convert the image to a tensor format before passing it to the node. You can use libraries like PyTorch to handle this conversion.

RuntimeError: Input image tensor is not on CPU

  • Explanation: This error occurs when the input image tensor is not on the CPU, which is required for processing.
  • Solution: Ensure that the image tensor is moved to the CPU using the .cpu() method before passing it to the node.

Remap Range Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Image-Filters
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.