Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.comfy.org/llms.txt

Use this file to discover all available pages before exploring further.

This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! Edit on GitHub
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

ParameterData TypeRequiredRangeDescription
imageIMAGENo-Optional base image to paint over. If not provided, a blank canvas is created using the specified background color, width, and height.
maskSTRINGYes-The 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.
widthINTYes64 to 4096The width of the canvas in pixels, used when no base image is provided. The value must be a multiple of 64. Default is 512.
heightINTYes64 to 4096The height of the canvas in pixels, used when no base image is provided. The value must be a multiple of 64. Default is 512.
bg_colorCOLORYes-The 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).
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 NameData TypeDescription
IMAGEIMAGEThe final composited image. This is the result of blending the painted areas (from the mask) over the provided base image or the colored background.
MASKMASKThe alpha channel (transparency) mask extracted from the painting. White areas represent the painted regions, and black areas represent the untouched background.

Source fingerprint (SHA-256): 217a6d8abbad02cb43cab18d0a592bdd5bfbfe321a742d0c14e8f4e1fa5e2630