Visit ComfyUI Online for ready-to-use ComfyUI environment
Apply masks to images for selective visibility control, essential for compositing and image processing tasks.
The MaskImage
node is designed to apply a mask to an image, effectively allowing you to selectively reveal or conceal parts of the image based on the mask's values. This node is particularly useful in image processing tasks where you need to focus on specific areas of an image while ignoring others. By multiplying the image with the mask, the node ensures that only the areas corresponding to the mask's active regions are visible in the output. This operation is essential for tasks such as compositing, where precise control over image visibility is required. The MaskImage
node leverages the power of tensor operations to efficiently handle image and mask data, making it a valuable tool for AI artists looking to manipulate images with precision.
The image
parameter expects an input of type IMAGE
, which is the main image you want to process. This parameter is crucial as it provides the base content that will be affected by the mask. The image should be in a format compatible with tensor operations, typically a multi-dimensional array representing pixel values. The quality and resolution of the image can impact the final output, so it's important to use an image that meets your project's requirements.
The mask
parameter requires an input of type MASK
, which is used to determine which parts of the image will be visible in the output. The mask is a tensor that should have the same spatial dimensions as the image, ensuring that each pixel in the mask corresponds to a pixel in the image. The mask values typically range from 0 to 1, where 0 represents fully transparent (concealed) areas and 1 represents fully opaque (visible) areas. This parameter is essential for controlling the visibility of different parts of the image.
The output of the MaskImage
node is an IMAGE
, which is the result of applying the mask to the input image. This output image retains the original dimensions of the input image but only displays the areas specified by the mask. The masked image is useful for further processing or as a final output in image compositing tasks. The output image's quality and appearance depend on the input image and mask, so careful selection of these inputs is important for achieving the desired result.
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.