MaskDetailer (pipe)
Detailer-quality inpainting on a mask you draw yourself
- image
- mask
- basic_pipe
- refiner_basic_pipe_opt
- detailer_hook
- scheduler_func_opt
- image
- cropped_refined
- cropped_enhanced_alpha
- basic_pipe
- refiner_basic_pipe_opt
MaskDetailer (pipe) is the Impact Pack's answer to "I already know where I want to fix - I just want it done at proper resolution." It's a simple inpaint node that runs the pack's crop-resample-paste detailer on a mask you provide, instead of one a YOLO detector found. No detection step, no SEGS - you hand it an image and a mask, and it refines the masked region the same way FaceDetailer refines a face.
That distinction is the whole point. Every other detailer in the pack starts by finding the region. This one skips that. When you've painted a mask in a Preview Bridge, generated one with CLIPSeg, or built it out of mask operations, MaskDetailer is how you get the detailer's only-the-region, full-resolution treatment without pretending a detector needs to be involved. Think of it as "inpaint this spot, but crop and upscale it first so the detail actually lands."
How it works
You give it an image, a mask, and a BASIC_PIPE (model, clip, vae, positive, negative bundled together). It crops the masked area with padding, scales it toward guide_size, runs a sampling pass on that crop, and composites it back under a feathered mask - the identical detailer loop, driven by your mask rather than a detection. Because it's a masked regional resample, all the ordinary inpainting intuition applies: low denoise for a touch-up, higher for a rework, and composite-only-the-region so the rest of the frame never round-trips the VAE.
The inputs and outputs that matter
image,mask(required) - the picture and the region to refine. The mask is yours to supply.basic_pipe(required) - model/clip/vae/positive/negative in one bundle, built withToBasicPipe.guide_size(default 512) - the size the masked crop is scaled to before resampling. Where the detail comes from.denoise(default 0.5) - how far the region departs from the original. 0.3–0.4 to clean up, higher to genuinely change what's there.mask_mode(default true) - refine inside the mask (the normal case).feather(default 5) andcrop_factor(default 3) - paste-edge softness and how much surrounding context the crop keeps.contour_fill(default true) - fills the interior of a hollow/outline mask so the whole enclosed area gets treated, not just the drawn line.cycle(default 1) andbatch_size(default 1) - refine passes, and how many candidate results to sample per region.
Optional inpaint_model, refiner_basic_pipe_opt (for an SDXL refiner), and detailer_hook cover advanced setups. Outputs: image (the fixed frame), cropped_refined and cropped_enhanced_alpha (the crop for inspection), and the basic_pipe passed through for chaining.
How to install it
Install the pack via ComfyUI Manager (search ComfyUI Impact Pack, install, restart), or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack comfyui-impact-pack
cd comfyui-impact-pack
python -m pip install -r requirements.txt # ComfyUI's python; python_embeded on portable
then restart. Unlike the detector-driven detailers, this one needs no Subpack and no detection models - you're bringing the mask, so there's nothing to detect. Linux still wants libgl1-mesa-glx and libglib2.0-0 for OpenCV.
Common issues & troubleshooting
The fix bled outside where I painted. Check crop_factor and feather - a large crop factor pulls in a lot of context, and heavy feather softens the mask edge. Also confirm contour_fill is behaving: if your mask is an outline rather than a filled shape, contour_fill true fills it in, which may cover more than you meant.
The masked area barely changed. denoise too low, or the mask is tiny relative to guide_size so there's little to work with. Raise denoise toward 0.5–0.6 for a real change.
Grey or colour-shifted patch. The usual VAE-mismatch culprit - make sure the VAE in your basic_pipe matches the model. This is the same encode/decode colour shift people hit with any inpaint pass.
Why not just use a normal inpaint node? You can - but a plain inpaint samples the masked area at whatever resolution it sits at in the frame. MaskDetailer crops and upscales it first, so a small region gets a full generation budget. That's the difference between "fixed" and "fixed and actually detailed."
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| basic_pipe | BASIC_PIPE | — | |
| guide_size | FLOAT | 51264–16384 | — |
| guide_size_for | BOOLEAN | true | — |
| max_size | FLOAT | 102464–16384 | — |
| mask_mode | BOOLEAN | true | — |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 8.000–100 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 17 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +11 | |
| denoise | FLOAT | 0.500.0001–1 | — |
| feather | INT | 50–100 | — |
| crop_factor | FLOAT | 3.01–10 | — |
| drop_size | INT | 101–16384 | — |
| refiner_ratio | FLOAT | 0.200–1 | — |
| batch_size | INT | 11–100 | — |
| cycle | INT | 11–10 | — |
| refiner_basic_pipe_optopt | BASIC_PIPE | — | |
| detailer_hookopt | DETAILER_HOOK | — | |
| inpaint_modelopt | BOOLEAN | false | — |
| noise_mask_featheropt | INT | 200–100 | — |
| bbox_fillopt | BOOLEAN | false | — |
| contour_fillopt | BOOLEAN | true | — |
| scheduler_func_optopt | SCHEDULER_FUNC | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| cropped_refined | IMAGE | — |
| cropped_enhanced_alpha | IMAGE | — |
| basic_pipe | BASIC_PIPE | — |
| refiner_basic_pipe_opt | BASIC_PIPE | — |