Visit ComfyUI Online for ready-to-use ComfyUI environment
Adjust grayscale intensity of masked image areas for artistic effects with scale factor and mask inversion.
The BackgroundScaler node is designed to adjust the color of specific areas within an image based on a provided mask. This node is particularly useful for AI artists who want to manipulate the grayscale range of masked regions in their images. By applying a scale factor to the masked areas, you can achieve various artistic effects, such as highlighting or dimming certain parts of the image. The node also offers an option to invert the mask, providing additional flexibility in how the scaling is applied. Overall, the BackgroundScaler node is a powerful tool for fine-tuning the visual elements of your artwork, allowing for precise control over the grayscale intensity of selected regions.
This parameter expects an image in the form of a 4D tensor. The image serves as the base on which the scaling effect will be applied. The image must be a 4D tensor to ensure compatibility with the node's processing requirements.
The mask parameter is a tensor that defines the areas of the image to be affected by the scaling. It can be either a 3D or 4D tensor. If a 3D tensor is provided, it will be automatically adjusted to a 4D tensor by adding an extra dimension. The mask essentially acts as a stencil, determining which parts of the image will undergo the grayscale adjustment.
This is a floating-point value that determines the intensity of the grayscale adjustment applied to the masked areas. The scale parameter has a default value of 0.5, with a minimum value of -10.0 and a maximum value of 10.0. Adjusting this value will either lighten or darken the masked regions, depending on the scale factor used.
The invert parameter is a boolean that, when set to True, inverts the mask. This means that the areas not covered by the mask will be affected by the scaling, while the masked areas will remain unchanged. The default value for this parameter is False.
The output is an image tensor with the same dimensions as the input image. This tensor represents the original image with the grayscale adjustments applied to the specified masked areas. The output image will have its pixel values clamped between 0 and 1 to ensure valid image data.
© Copyright 2024 RunComfy. All Rights Reserved.