Visual Mask Editor 🎨
Paint a mask directly on the image, undo included
- image
- mask
- crop_data
- edited_mask
- crop_image
- crop_data
Most of the time you never want to hand-paint a mask - a detector finds the face, the face gets detailed, done. But sometimes the detector gets it wrong, or you want to detail a region no detector knows about, or you need to clean up the edge the detector drew. IkkiMaskEditor is the paint-a-mask node for those cases, and it's the only node in the pack's detailer chain that's designed to be interacted with rather than just wired together.
It opens a big canvas right on the node, over the image. You brush in or brush out mask coverage with an Add Mask / Remove Mask toggle, switch between an Overlay view (red tint over the image) and a B&W mask view, pick a brush color, and - the thing that makes hand-masking tolerable - there's a real undo/redo history, not just "start over." It's a miniature image editor bolted onto a ComfyUI node, which is the right call for a job people do constantly and hate.
How it works
Two modes, and it decides based on what you give it:
- Standalone mask creator. Feed only an image and it initializes a blank mask and you paint one from scratch. That's your hand-masked inpaint or detail region.
- Mask editor. Feed an image plus an existing mask (and optionally crop_data) and you start from the detected mask and refine it - erase a sloppy edge, extend coverage to the eyebrow that got missed.
The painted result is sent to Python as a base64 PNG, decoded into a mask, and combined with any input mask. Outputs are edited_mask (your final mask), crop_image (the image, passed through for convenience), and crop_data (passed through if you supplied it). Because it's an output node with a big UI, it slots naturally into the detailer chain: feed its edited_mask into IkkiDetailerKSampler's crop_mask to replace the detector's mask with your hand-drawn one, or into IkkiColorMatching's mask input to scope a color match to a region. You can also hand it to IkkiDetailerProcessor's override_mask if you want the processor's crop to be built around your drawing.
Install
Via ComfyUI Manager (search "ikki") or:
cd ComfyUI/custom_nodes
git clone https://github.com/RedsAnalysis/comfyui-ikki-pack
# restart ComfyUI
No extra pip packages.
Common issues
- The canvas is blank - the node saves the image to ComfyUI's temp folder and the frontend loads it back. If that round-trip fails (often an API/temp-path issue), you get an empty canvas. Rerun the node so the temp files regenerate.
- My painted mask isn't taking effect - you painted in the wrong view or the node ran before you finished. Re-run after painting; the paint is only committed on execution.
- It's an output node - it won't sit quietly in the middle of a chain. You'll need a Reroute or an intermediate step if you want the mask flowing onward, because output nodes end the visual chain in some UI layouts.
If you already own a mask editor you love, this won't change your life. But it's the one node in the Ikki detailer pipeline that gives you manual control over the automated loop - and for a pack this new, a hand-drawn mask is often exactly what you need when the detector surprises you.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| maskopt | MASK | — | |
| crop_dataopt | CROP_DATA | — | |
| edited_mask_dataopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| edited_mask | MASK | — |
| crop_image | IMAGE | — |
| crop_data | CROP_DATA | — |