ComfyUI > Nodes > ComfyUI > Painter

ComfyUI Node: Painter

Class Name

Painter

Category
image
Author
ComfyAnonymous (Account age: 763days)
Extension
ComfyUI
Latest Updated
2026-05-13
Github Stars
112.77K

How to Install ComfyUI

Install this extension via the ComfyUI Manager by searching for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Painter Description

Facilitates image creation and manipulation with masks for blending patterns onto images or canvases.

Painter:

The Painter node is designed to facilitate the creation and manipulation of images by applying a mask over a base image or a specified background color. This node is particularly useful for artists who want to blend or overlay specific patterns or designs onto an existing image or a newly created canvas. By utilizing a mask, you can control which parts of the image are affected, allowing for precise and creative modifications. The node supports resizing the mask to fit the dimensions of the base image, ensuring seamless integration. This functionality is essential for tasks that require detailed image editing, such as inpainting or compositing, where maintaining the integrity of the original image while adding new elements is crucial.

Painter Input Parameters:

mask

The mask parameter is a crucial input that determines the areas of the image to be modified. It accepts a file path to an image that acts as a stencil, where the non-transparent parts of the mask will be applied to the base image. If the mask is not provided or is empty, the node will not apply any modifications, and the base image will remain unchanged. This parameter allows for creative control over which parts of the image are altered, making it essential for tasks like inpainting or selective editing.

width

The width parameter specifies the width of the base image or canvas to be created if no initial image is provided. It defines the horizontal dimension in pixels and is used to set the size of the new image. This parameter is important when starting with a blank canvas, as it determines the overall size of the image you will work with.

height

The height parameter defines the vertical dimension of the base image or canvas in pixels. Similar to the width parameter, it is used when no initial image is provided, setting the size of the new image. This parameter is crucial for establishing the proportions of the canvas, ensuring that the final image meets your specific requirements.

bg_color

The bg_color parameter allows you to set the background color of the canvas when no initial image is provided. It accepts a color in hexadecimal format (e.g., #000000 for black) and fills the entire canvas with this color. This parameter is useful for creating a solid background on which you can apply the mask, providing a base for further image manipulation.

image

The image parameter is an optional input that allows you to provide an existing image to be used as the base for applying the mask. If an image is provided, the node will use its dimensions and content as the starting point for modifications. This parameter is essential when you want to enhance or alter an existing image rather than starting from scratch.

Painter Output Parameters:

out_image

The out_image parameter is the primary output of the Painter node, representing the final composited image after applying the mask. It contains the modified image data, where the mask has been blended with the base image or background color. This output is crucial for viewing and saving the results of your image manipulation, allowing you to see the effects of the mask application.

mask_tensor

The mask_tensor parameter is an output that provides the mask data in tensor format. It represents the transparency information of the mask, indicating which parts of the image were affected by the mask application. This output is useful for further processing or analysis, as it allows you to understand the areas of the image that were modified.

Painter Usage Tips:

  • Ensure that the mask image is in a compatible format and has transparency information to achieve the desired blending effect with the base image.
  • When creating a new canvas, carefully choose the width, height, and bg_color parameters to match the intended design and ensure that the final image meets your specifications.
  • Use high-resolution masks to maintain image quality and avoid pixelation when resizing the mask to fit the base image dimensions.

Painter Common Errors and Solutions:

Mask file not found

  • Explanation: The specified mask file path does not exist or is incorrect.
  • Solution: Verify the file path and ensure that the mask image is located in the correct directory.

Image size mismatch

  • Explanation: The dimensions of the mask do not match the base image, causing resizing issues.
  • Solution: Ensure that the mask is resized to match the dimensions of the base image using the node's built-in resizing functionality.

Invalid background color format

  • Explanation: The bg_color parameter is not in the correct hexadecimal format.
  • Solution: Use a valid hexadecimal color code (e.g., #FFFFFF for white) to specify the background color.

Painter Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Painter