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

| Parameter | Description | Data Type | Required | Range |
| --- | --- | --- | --- | --- |
| `image` | Optional base image to paint over. If not provided, a blank canvas is created using the specified background color, width, and height. | IMAGE | No | - |
| `mask` | 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. | STRING | Yes | - |
| `width` | 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. | INT | Yes | 64 to 4096 |
| `height` | 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. | INT | Yes | 64 to 4096 |
| `bg_color` | 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). | COLOR | Yes | - |

**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 Name | Description | Data Type |
| --- | --- | --- |
| `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. | IMAGE |
| `MASK` | The 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](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/Painter/en.md)

---
**Source fingerprint (SHA-256):** `217a6d8abbad02cb43cab18d0a592bdd5bfbfe321a742d0c14e8f4e1fa5e2630`
