Visit ComfyUI Online for ready-to-use ComfyUI environment
Apply mosaic effect to images by dividing into blocks and replacing with single color, ideal for stylizing or anonymizing.
The ImageMosaic node is designed to apply a mosaic effect to images, which is a popular technique used to obscure or stylize parts of an image by dividing it into smaller blocks and replacing each block with a single color. This effect is often used in digital art to create a pixelated look or to anonymize parts of an image. The node works by calculating the average color of each block and applying this color to the entire block, resulting in a distinctive mosaic appearance. This process can be particularly useful for artists looking to add a unique texture or pattern to their work, or for those who need to obscure sensitive information in an image while maintaining an artistic touch.
The image
parameter is the primary input for the ImageMosaic node, representing the image to which the mosaic effect will be applied. This parameter expects an image in the form of a tensor, which is a multi-dimensional array used to store the image data. The image should be in a format that the node can process, typically a torch tensor, ensuring that the image data is correctly interpreted and manipulated by the node.
The mosaic_size
parameter determines the size of the blocks used in the mosaic effect. It is an integer value that specifies how many blocks the image will be divided into along each dimension. A smaller mosaic_size
results in larger blocks and a more pronounced mosaic effect, while a larger mosaic_size
creates smaller blocks and a subtler effect. The parameter has a default value of 10, with a minimum value of 1 and a maximum value of 100. Adjusting this parameter allows you to control the granularity of the mosaic effect, tailoring it to your specific artistic needs.
The output of the ImageMosaic node is an IMAGE
, which is the processed image with the mosaic effect applied. This output is a torch tensor that represents the modified image data, ready for further processing or display. The mosaic effect alters the visual appearance of the image by replacing each block with its average color, resulting in a pixelated look that can be used for artistic or privacy purposes.
mosaic_size
values to achieve the desired level of detail in your mosaic effect. Smaller values will create a more abstract and pixelated look, while larger values will retain more of the original image's detail.mosaic_size
parameter is set to a value outside the allowed range.mosaic_size
parameter to be within the range of 1 to 100. This ensures that the node can correctly process the image and apply the mosaic effect.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.