MaskPro
The brush ComfyUI never shipped
- image
- mask
- mask
- image
- image_rgba
ComfyUI has always been weird about masks. It can blur them, threshold them, grow them, even generate them with a detector - but natively there is no way to just paint one. You're supposed to drop a black-and-white PNG in from GIMP, or accept whatever mask a model inferred. MaskPro fixes that gap: it's a real, browser-based mask editor living inside a ComfyUI node, with brush, lasso, magic wand, gradients and an AI cutout, and it's non-destructive the whole way through.
If you still do manual inpainting - and the people who do have good reasons, mostly that an edit model drifts on every pixel it wasn't told to touch - this is the "you paint a mask, you pick a denoise" half of the workflow, except you no longer have to leave ComfyUI to do the painting. It's also handy for compositing, background swaps, and any ControlNet or detail pass that wants a mask-shaped input you actually control.
How it works
The node on your graph is a thin shell. The real work happens in a fullscreen editor that ships as a web app inside the pack, and the node syncs with it through a local cache at ComfyUI/user/orion4d_cache/maskpro_<NODE_ID>/, where each node instance stores an image.png reference and a high-precision mask.png. The node class reports IS_CHANGED as time.time(), which is a polite way of saying it always re-runs - that's how it picks up your latest edits from the editor instead of caching them away.
Two conventions are worth knowing because they trip people up. Inside the editor the mask uses "paint" convention, white = painted (the part you're touching). On output that's flipped to the ComfyUI-friendly "white = keep" convention, so the mask output is 0..1 with white as the kept area, exactly as the README documents. The invert_mask boolean flips that back if your downstream node expects white = the region to change. And if your wired-in mask isn't the same size as the image, the node center-crops or pads it to match rather than silently misaligning your edits.
Inputs and outputs
Only three inputs, all optional. Feed image in if you want to paint against something, and mask if you want to start from an existing mask (a SAM output, a detector result, whatever) and refine it by hand. invert_mask is the toggle described above.
The three outputs cover how you'll want to use the result: mask (MASK) goes into Set Latent Noise Mask or a ControlNet inpaint condition; image is a straight passthrough of whatever you fed in, handy for keeping the chain intact; and image_rgba is your original image with the mask burned into the alpha channel - ready for a PNG Save node and straight into a compositor.
Inside the editor
Brushes up to 2048px with hardness, spacing, rotation and smoothing, and you can drop your own PNG brushes into web/brushes/ and pick them from the brush grid. Lasso, freehand and polygonal. Rectangle and ellipse with rounded corners. Linear or radial gradients. A magic wand with tolerance and edge smoothing. Full undo/redo (Ctrl+Z / Ctrl+Y), cursor-centered zoom, hand tool, and an auto-run option so the workflow fires as soon as you hit Save & Close. The keyboard map is worth learning: B brush, L lasso, W wand, G gradient, X toggles erase, I inverts, A fills the selection.
There's also the "AI cutout" button. It's a wrapper around BiRefNet, plus optional rembg support. Honest take: if a cutout is all you wanted, ComfyUI has shipped BiRefNet natively since May 2026, so you don't need this pack for that. Where it earns its place is the merge - run the cutout, then clean up the hairline with the brush instead of switching tools.
Install
ComfyUI Manager → search "Orion4D_maskpro", or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/Orion4D_maskpro
# restart ComfyUI
The core editor has no hard Python dependencies - no requirements.txt, it rides on ComfyUI's own torch/Pillow. The extras are the catch: the BiRefNet cutout needs the safetensors in models/BiRefNet (download from the 1038lab/BiRefNet repo on HuggingFace), and rembg support is a lazy import, so you'll get a clean "rembg not installed" error until you pip install rembg yourself.
Where people get burned
The cache is wiped on every ComfyUI startup - the source rmtrees orion4d_cache at import. So save your work and run before you restart, or an in-progress mask reverts to whatever's wired into the node. And remember the white = keep convention: if your inpaint comes out painting the wrong half of the image, it's not the node being broken, it's the convention mismatch - tick invert_mask and move on.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| imageopt | IMAGE | — | |
| maskopt | MASK | — | |
| invert_maskopt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| image | IMAGE | — |
| image_rgba | IMAGE | — |