Nodes/comfyui-mixlab-nodes/Edit Mask ♾️Mixlab
ComfyUI Node Runs on cloud

Edit Mask ♾️Mixlab

Paint a mask by hand right in the graph

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
Edit Mask ♾️Mixlab
  • image
  • image_update
  • image
  • mask

Sometimes you don't want a detector or a segmentation model to decide what gets masked - you want to grab a brush and paint the region yourself. Edit Mask gives you a paint surface right on the node: load an image, draw over the part you care about, and it hands back both the image and the mask you drew. It's the manual-masking answer inside a pack that's otherwise full of automatic tools.

This matters more than it sounds, because hand-masking is exactly the interface ComfyUI is famously bad at. The inpainting KB has a whole thread of people complaining that Comfy's masking UX loses to A1111 and Forge - "overly extravagant workarounds for the simplest part of the process (masking)." Edit Mask is one attempt to put a real, direct paint tool back in the graph so you're not fighting a clunky mask editor to draw a simple region.

How it works

The node embeds a small canvas. You give it an image, you paint on it in the node's UI, and the strokes become a MASK (white where you painted). It's an output node, so it renders that editable surface in the UI rather than silently passing data through - the drawing is the interaction. What you paint is what downstream nodes receive.

Because you're painting by hand, this is a workstation/interactive node by nature: the value is the live brush. It's the natural front end for the pack's own LaMa Inpainting (erase what you paint) or any VAE-encode-for-inpaint step.

Inputs and outputs

  • image (IMAGE, required) - the picture you paint on.
  • image_update (IMAGE_FILE, optional) - a mechanism to refresh/replace the image loaded into the editor, so you can update the underlying picture without rebuilding the node.

Outputs are the pair you want for masked editing:

  • image (IMAGE) - the image, passed through.
  • mask (MASK) - what you painted.

Wire the mask into whatever consumes a mask - LaMa Inpainting to erase, a VAE Encode For Inpaint to regenerate, ImageCompositeMasked to composite - and pass the image alongside it. Having both come out of one node keeps the pairing clean so you don't accidentally mask image A against image B.

How to install it

Ships with the Mixlab pack.

  • ComfyUI Manager: search comfyui-mixlab-nodes, install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git, install requirements (install.bat on Windows or ../../../python_embeded/python.exe -s -m pip install -r requirements.txt), restart.

Common issues

Nothing to paint on / canvas blank: the node needs an image input to draw over. If nothing's loaded, there's no surface. Feed it a Load Image (or the pack's own loaders) first.

Hard-edged mask leaves a seam: what you paint comes out as a crisp mask. For inpainting or compositing you usually want a soft edge, so run the mask through a feather/blur node before the encode step. The inpainting KB's rule of thumb is a few pixels of blur to avoid visible seams - that guidance applies here too.

The mask isn't updating / feels stuck: this is a UI-heavy node in a pack whose front-end JavaScript has a history of occasionally wedging the ComfyUI canvas. If the editor stops responding, reload the browser tab before assuming your mask is lost. Keeping the pack updated helps, since the maintainer patches these front-end issues over time.

It's fiddly on huge images: painting a precise mask on a very large image inside a small node canvas is genuinely awkward. If you need pixel-accurate control on a big frame, a dedicated external masking UI (Krita's ComfyUI plugin, or A1111/Forge-style inpaint canvases) is still the more comfortable tool - Edit Mask is best for quick, rough regions you draw in seconds.

Category♾️Mixlab/Mask

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
image_updateoptIMAGE_FILE

Outputs (2)

NameTypeDescription
imageIMAGE
maskMASK