Skip to main content
The Painter node provides an interactive canvas for creating or editing images and masks directly within ComfyUI. It allows you to start with a blank canvas or an existing image, paint on it using a brush tool, and outputs both the resulting image and a corresponding alpha mask. The mask defines the painted areas, which are then composited over the base image or background color.

Inputs

ParameterDescriptionData TypeRequiredRange
imageOptional base image to paint over. If not provided, a blank canvas is created using the specified background color, width, and height.IMAGENo-
maskThe painting data, typically generated by the node’s built-in interactive widget. This parameter is managed by the UI’s painter tool and is not meant to be connected to a standard socket.STRINGYes-
widthThe width of the canvas in pixels, used when no base image is provided. The value must be a multiple of 64. Default is 512.INTYes64 to 4096
heightThe height of the canvas in pixels, used when no base image is provided. The value must be a multiple of 64. Default is 512.INTYes64 to 4096
bg_colorThe background color for the canvas, specified as a hex code (e.g., #000000). This is only used when no base image is provided. Default is black (#000000).COLORYes-
Note: The mask input is designed to work with the node’s specialized UI widget. When you paint on the canvas, the widget automatically populates this value. The width and height inputs are hidden in the standard UI but define the canvas dimensions when creating a new image. If a base image is provided, its dimensions override the width and height settings.

Outputs

Output NameDescriptionData Type
IMAGEThe final composited image. This is the result of blending the painted areas (from the mask) over the provided base image or the colored background.IMAGE
MASKThe alpha channel (transparency) mask extracted from the painting. White areas represent the painted regions, and black areas represent the untouched background.MASK
This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! Edit on GitHub

Source fingerprint (SHA-256): 217a6d8abbad02cb43cab18d0a592bdd5bfbfe321a742d0c14e8f4e1fa5e2630