Nodes/comfyui-ComfyUI-Basic-Drawing/🎨 Basic Drawing Board
ComfyUI Node

🎨 Basic Drawing Board

The Basic Drawing Board turns scribbles into edit-model guides

By lololerigolo60·Created 5 months ago·Updated 5 months ago· 2
🎨 Basic Drawing Board
  • image
  • auto_mask
  • IMAGE
  • MASK
image_data
width512
height512

The name undersells it. Basic Drawing Board isn't a drawing tool that outputs drawings - it's a canvas that produces the exact pair of things the new breed of edit models (Flux 2 Klein, Flux Kontext, Qwen-Image-Edit) want: an IMAGE that shows your sketch composited over a background, and a MASK that marks where you drew. You paint a red circle and a green rectangle, prompt "a red apple on a table," and the model renders your blobs as real objects. The brushstrokes are the composition and color plan; the model is the painter.

That's genuinely useful in 2026, because instruction editors are the default way to modify an image - but they take the whole image as context and nudge every pixel. If you want an accessory placed in exactly one spot, or a pose changed without the room drifting, a mask is the difference between "edit" and "regenerate." This node gives you the mask and the visual guide in one shot, plus a real canvas to draw them with: brush, paint bucket fill, eraser, eyedropper, undo/redo (Ctrl+Z / Ctrl+Y), and a Sync button that loads whatever you've wired into the image input behind your sketch. The README's "decal" method is the slick one: load a reference photo, trace over it, then hit the clear-background button so only your outline survives, and let the model render the trace.

How it works

The node's body is an HTML5 canvas living in a hidden widget. Your drawing lives on one layer as a base64 PNG stuffed into the image_data string - you never touch that field, the JS updates it on every stroke. When the graph runs, process_drawing decodes your sketch, composites it over the background (the image input if connected, otherwise a black canvas), resizes everything to width × height, and emits:

  • IMAGE - your drawing over the background, as an RGB tensor. The visual guide.
  • MASK - your drawing's alpha channel, thresholded to 1.0 where you drew, 0.0 elsewhere. This is the AI's workspace.

The optional inputs feed the toolbar, not the model. image is just the background layer (Sync pulls it in); auto_mask is a MASK from a segmentation node like SAM - the code fuses multiple SAM detections into one (max across the batch dimension) so the Auto button can flood-fill the detected region with your color. Wire both outputs into your edit-model node and you're done.

The inputs that actually matter

  • width / height (INT, 64–4096, default 512) - canvas resolution. Set them to your generation resolution; everything gets resized to this on run.
  • image (optional IMAGE) - background reference for tracing.
  • auto_mask (optional MASK) - SAM/segmentation output for the Auto button.

Install

Via ComfyUI Manager (search Basic Drawing Board), or:

cd ComfyUI/custom_nodes
git clone https://github.com/lololerigolo60/comfyui-ComfyUI-Basic-Drawing

Then restart ComfyUI. No requirements.txt ships with the repo, and none is needed - the code only uses numpy, Pillow, and torch, all of which ComfyUI already has. No model downloads.

Gotchas

  • Ignore docs/INSTALLATION.md. It's stale boilerplate that references a different repo name (ComfyUI-Basic-Drawing_4_flux2Klein) and tells you to pip install matplotlib and pandas that nothing in the code imports. Clone, restart, go.
  • Your strokes get resampled, not re-inked. Draw at 512 and generate at 1024 and your sketch is LANCZOS-upscaled, which goes soft. Match width/height to what you'll actually render.
  • The mask is binary. Alpha above zero becomes 1.0 - no feathering. If you see hard seams in the edit, blur or feather the mask before it hits the model.
  • Color is the whole game. The closer your stroke color is to the final result, the more faithful the render - the README's own tip (dark blue for a night sky) and it's the real deal, since edit models read your blobs as both structure and color intent.

The pack is brand-new and community-signal-thin, so expect rough edges - but for sketch-to-photo composition and trace-over-reference edits on Klein, nothing else in the graph draws quite this directly into the model's language.

CategoryCustomNodes/Drawing

Inputs (5)

NameTypeDefaultDescription
image_dataSTRING
widthINT51264–4096
heightINT51264–4096
imageoptIMAGE
auto_maskoptMASK

Outputs (2)

NameTypeDescription
IMAGEIMAGE
MASKMASK