Visit ComfyUI Online for ready-to-use ComfyUI environment
Transform non-black pixels in images/videos to specified color, maintaining black areas as pure black for consistent color scheme.
The AK_NormalizeMaskImage node is designed to transform the color of non-black pixels in an input image or video to a specified color. This node is particularly useful for artists and creators who want to apply a uniform color scheme to their visual content while maintaining the black areas as pure black. By setting a threshold, the node distinguishes between black and non-black pixels, allowing for precise color normalization across frames. This functionality is beneficial for creating consistent visual effects, enhancing the aesthetic appeal of images, and ensuring that specific color themes are adhered to in video sequences.
The image
parameter represents the input video tensor, which should have the shape (num_frames, H, W, C)
, where num_frames
is the number of frames, H
is the height, W
is the width, and C
is the number of color channels. This parameter is crucial as it provides the raw visual data that will be processed by the node to apply the specified color normalization.
The threshold
parameter is a numerical value used to determine which pixels are considered black. Pixels with brightness below this threshold are treated as black and remain unchanged, while those above are altered to the specified color. This parameter is essential for controlling the sensitivity of the black pixel detection, allowing for fine-tuning of the color normalization process. The exact range of values is not specified, but it typically ranges from 0 to 255, corresponding to the intensity levels of a pixel.
The r
parameter specifies the red channel value (0-255) for the non-black pixels. This value determines the intensity of the red color that will be applied to the non-black areas of the image. Adjusting this parameter allows you to control the red component of the target color, enabling customization of the visual output.
The g
parameter specifies the green channel value (0-255) for the non-black pixels. Similar to the r
parameter, this value sets the intensity of the green color for the non-black areas. By modifying this parameter, you can adjust the green component of the target color, providing further control over the color normalization.
The b
parameter specifies the blue channel value (0-255) for the non-black pixels. This value determines the intensity of the blue color that will be applied to the non-black areas of the image. By changing this parameter, you can control the blue component of the target color, allowing for precise color customization.
The IMAGE
output parameter represents the processed video tensor, where non-black pixels have been set to the specified color while black pixels remain unchanged. This output is crucial for visualizing the effects of the color normalization process, providing a consistent and aesthetically pleasing result that adheres to the specified color scheme. The output maintains the original shape of the input, ensuring compatibility with subsequent processing steps or display requirements.
r
, g
, and b
parameters to match your desired color. This will ensure that all non-black areas are uniformly colored, enhancing the visual consistency of your project.threshold
parameter to fine-tune the sensitivity of black pixel detection. A lower threshold will result in more pixels being considered black, while a higher threshold will allow more pixels to be colored, providing flexibility in achieving the desired effect.(num_frames, H, W, C)
.r
, g
, or b
parameters are set outside the valid range of 0-255.r
, g
, and b
parameters, ensuring they are within the 0-255 range to represent valid color intensities.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.