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 GitHubThe 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
| Parameter | Data Type | Required | Range | Description |
|---|---|---|---|---|
image | IMAGE | No | - | Optional base image to paint over. If not provided, a blank canvas is created using the specified background color, width, and height. |
mask | STRING | Yes | - | 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. |
width | INT | Yes | 64 to 4096 | The width of the canvas in pixels, used when no base image is provided. The value must be a multiple of 64. Default is 512. |
height | INT | Yes | 64 to 4096 | The 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_color | COLOR | Yes | - | 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). |
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 Name | Data Type | Description |
|---|---|---|
IMAGE | IMAGE | The final composited image. This is the result of blending the painted areas (from the mask) over the provided base image or the colored background. |
MASK | MASK | The 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