Nodes/IAMCCS-nodes/GoyAIcanvas Paint (Image + Mask)
ComfyUI Node

GoyAIcanvas Paint (Image + Mask)

Paint an inpaint mask with a real brush, not by guessing pixels

By IAMCCS·Created 11 months ago·Updated 8 days ago· 113
GoyAIcanvas Paint (Image + Mask)
  • source_image
  • image
  • mask
  • report
paint_data
width1024
height576
fallbackconnected_image

Every inpainting workflow needs a mask, and the fastest way to get a good mask is to draw it. But ComfyUI's built-in mask painting is basic, and if you're doing Ideogram-style image editing, you often want to paint and see the image you're editing at the same time. GoyAIcanvas Paint is a small dedicated painter: open its canvas, import or connect an image, brush over what you want changed, and it outputs both the IMAGE and the MASK ready for your inpainting or edit nodes.

The name tells you the scope - it's a canvas paint utility, deliberately without the layer/gesture machinery of IAMCCS's bigger Frame Designer. If you just want image + mask out of a paint session, this is the one.

How it works

The frontend paints strokes into a JSON paint_data payload (an embedded image as a data URL plus a list of strokes with points, mode, and brush size). The backend, which is plain Python + PIL, then:

  1. Resolves the image. Priority order: an embedded image in paint_data wins, then the connected source_image (if fallback is connected_image), then a blank canvas at width×height.
  2. Builds the mask from strokes. Strokes marked paint fill white on the mask; erase strokes fill black (inpaint masks are conventionally white = area to regenerate). The brush size controls stroke width, and the code draws smooth lines with capped ends between points.
  3. Returns image, mask, and a report with stroke/pixel stats.

Both outputs match the image's dimensions - width and height are inferred from whichever image source actually got used, so you don't get a size-mismatched mask. The default fallback of connected_image means the connected image is used if the paint data is empty, which makes it forgiving for first-time wiring.

Inputs that matter

  • paint_data - the JSON the canvas writes; you don't hand-edit this.
  • source_image - optional IMAGE to paint over; connect it unless the canvas already embeds one.
  • width / height - only used when the fallback is a blank canvas. Defaults 1024×576.

Install

Part of IAMCCS-nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git

Or ComfyUI Manager → "IAMCCS" → install → restart. It uses only PIL/numpy/torch - no extra dependencies.

Gotchas

The mask is built from strokes at their stored coordinates - if the canvas was painted at a different resolution than the connected image, you can get misaligned masks, so paint at the image's native resolution. And remember the mask convention: painted = white (regenerate), erased = black (keep). If your inpaint fills the wrong area, check your stroke mode rather than the node. It's a source of clean IMAGE+MASK pairs, not an inpaint node itself - the actual editing happens downstream.

CategoryIAMCCS/Ideogram

Inputs (5)

NameTypeDefaultDescription
paint_dataSTRING
widthINT10241–8192
heightINT5761–8192
fallbackCOMBOconnected_image2 options: blank, connected_image
source_imageoptIMAGE

Outputs (3)

NameTypeDescription
imageIMAGE
maskMASK
reportSTRING