Visit ComfyUI Online for ready-to-use ComfyUI environment
Convert image regions to grayscale with mask control for targeted adjustments and creative effects.
The GrayScaler node is designed to convert specific regions of an image to grayscale based on a provided mask. This node is particularly useful for AI artists who want to highlight or de-emphasize certain parts of an image by turning them gray. By using a mask, you can precisely control which areas of the image are affected, allowing for creative and targeted adjustments. The intensity of the grayscale effect can be fine-tuned using a multiplier, giving you flexibility in achieving the desired visual outcome. This node is a powerful tool for adding depth and focus to your artwork by manipulating color and grayscale regions seamlessly.
The image
parameter is the input image tensor that you want to apply the grayscale effect to. This should be a 4D tensor, typically representing a batch of images with dimensions [batch_size, height, width, channels]. The image tensor serves as the canvas on which the grayscale effect will be applied based on the provided mask.
The mask
parameter is a tensor that indicates which areas of the image should be converted to grayscale. This can be a 3D or 4D tensor, where a value of 1 in the mask means that the corresponding area in the image will be turned gray. If the mask is 3D, it will be automatically adjusted to match the dimensions of the image tensor. The mask allows for precise control over which parts of the image are affected by the grayscale conversion.
The multiplier
parameter is a float value that controls the intensity of the grayscale effect. The default value is 1.0, with a minimum of 0.0 and a maximum of 10.0. This parameter allows you to fine-tune how gray the masked areas will become, giving you flexibility in achieving the desired visual effect. A higher multiplier will result in a more intense grayscale effect.
The output parameter image
is the modified image tensor with the specified regions turned gray based on the mask. This output retains the same dimensions as the input image tensor but with the grayscale effect applied to the masked areas. The output image can be used directly in your artwork or further processed as needed.
image
or mask
is not a tensor.image
and mask
parameters are provided as torch tensors.image
or mask
tensors do not match the expected format.image
tensor is 4D and the mask
tensor is either 3D or 4D. Adjust the dimensions if necessary.© Copyright 2024 RunComfy. All Rights Reserved.