ComfyUI Node

Painter Node

Draw your ControlNet input without leaving ComfyUI

By AlekPet·Created 3 years ago·Updated 10 days ago· 1,520
Painter Node
  • images
  • IMAGE
  • MASK
image
update_nodetrue

Scribble ControlNet wants a rough sketch - a few lines suggesting where things go, and the model fills in the rest. Most people end up opening an external image editor, drawing something, saving it, and loading it back into ComfyUI. PainterNode skips all of that: it's a drawing canvas built directly into the node, so you sketch right where the rest of your graph already lives, and the strokes come out as an IMAGE and a MASK you can plug straight into ControlNet or inpainting.

It's one of the older utility nodes in the wider ComfyUI ecosystem - before dedicated canvas packs existed, this was many people's first taste of drawing inside a node graph - and it still gets recommended for that reason. Just go in knowing it's a first-generation tool: it works, but it hasn't seen heavy development in a while, and there are rougher edges than you'd expect from something newer.

How it works

The node renders a canvas widget sized to the node window itself. You draw with your mouse or tablet directly on it - freehand strokes, no vector layers, just raster pixels. You can optionally feed in a background image so you're sketching over something (useful for scribble-guided edits rather than starting from blank). When you're done, the canvas contents come out as an IMAGE, and whatever you painted also produces a corresponding MASK - handy if you're feeding this into an inpainting workflow rather than (or alongside) ControlNet.

The inputs and outputs that matter

  • image (required) - this is a background-image selector for the canvas, not a wire input; think of it as "which reference image am I drawing on top of."
  • images (optional, IMAGE) - this is the actual wire input if you want to feed an upstream IMAGE into the canvas as a background from elsewhere in your graph.
  • update_node (default true) - whether the node re-renders/updates on graph changes; leave this on unless you have a specific reason to freeze it.
  • Outputs: IMAGE (your drawing) and MASK (derived from what you painted) - wire IMAGE into ControlNet's image input, and MASK into anything doing masked/inpainting work downstream.

How to install it

Via ComfyUI Manager: search "ComfyUI Custom Nodes AlekPet" and install. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet

Restart. No model downloads - it's a pure UI/canvas node, nothing to fetch.

Common issues & troubleshooting

The mask goes solid white when you use a background image. This is a known, reported limitation: when you feed PainterNode a background image, the mask output can lose fidelity and end up mostly or fully white instead of isolating just your painted strokes, because the background's own pixel data bleeds into what the node treats as "painted." If your masking depends on precisely isolating strokes over a background, budget time to work around this rather than assuming it'll just work.

"Given groups=1, weight of size [...], expected input[...] to have 3 channels, but got 4 channels instead." This is the single most common error people hit wiring PainterNode straight into a sampler or ControlNet apply node - the canvas output can carry an alpha channel (4 channels: RGBA) where the next node expects plain RGB (3 channels). The fix is a one-node insert: drop a Convert Image to RGB node between PainterNode and whatever's erroring.

Everything gets sluggish the longer you keep editing. Repeatedly tweaking a scribble in the same session (rather than starting fresh) has been reported to slow generation down more each time, independent of VRAM cleanup nodes - something appears to accumulate in the backend rather than clearing between edits. If a session gets laggy, restarting ComfyUI is the reliable fix; there's no confirmed cause beyond "it happens with repeated in-place edits."

Honest alternative check. If PainterNode's rough edges are a dealbreaker for you specifically around masking accuracy, worth knowing this pack isn't the only option - newer, more actively developed canvas nodes (Olm Sketch, Canvas Tab, ComfyUI's built-in Photopea integration) exist and some users have moved to them for exactly the reasons above. PainterNode still gets the job done for a quick scribble-to-ControlNet pass; it's the fussier masking work where people report reaching for something else.

CategoryAlekPet Nodes/image

Inputs (3)

NameTypeDefaultDescription
imageCOMBO1 options: example.png
imagesoptIMAGE
update_nodeoptBOOLEANtrue

Outputs (2)

NameTypeDescription
IMAGEIMAGE
MASKMASK