Nodes/mihaiiancu/Inpaint/Inpaint Mediapipe
ComfyUI Node

Inpaint Mediapipe

This node detects faces and hands — then forgets to actually inpaint them

By mihaiiancu·Created 3 years ago·Updated 2 years ago· 9
Inpaint Mediapipe
  • inpaint_model
  • image
  • Inpainted
  • Annotated
inpaint_type
prompt
negative_prompt
strength0.50
guidance_scale7.0
confidence0.50
match_color
blur_factor0

Let me save you the hour I just spent. Inpaint Mediapipe is built on a great idea - the ADetailer playbook, ported to ComfyUI: run Mediapipe over your image, find every face, hand, or body, and inpaint each region separately with its own pass. That's exactly how you fix the one thing that always comes out mangled at 512px. But here's the thing the name doesn't tell you: in the code that actually ships, the inpainting call is commented out. The "Inpainted" output is your input image, passed through untouched. What this node currently does is detect and draw red boxes.

Worth a read if you found this via Google and are about to wire it in, because you'll think you broke it. It didn't break - it's just unfinished.

How it works under the hood

The repo is a single commit from July 2023 with the honest message "working copy of the bounding boxes." That tells you everything. Pick face, hand, or body and the node dispatches to a Mediapipe model (face mesh, hands, or pose), collects the landmarks, and wraps them in a cv2.boundingRect. The annotated copy gets red rectangles drawn around each detection. Then impaint_image() loops over those boxes, crops each region, builds a black mask - and the actual diffusers call inside the loop is commented out. So the crop is pasted back unchanged.

There are two real bugs hiding in there too. blur_factor above 0 references ImageFilter, which is never imported - that throws a NameError. And match_color is parsed from the dropdown into a boolean and then never used; the histogram color-match function it was meant to drive is dead code. All consistent with "working copy."

The inputs that matter

  • inpaint_type - face, hand, or body. This is the whole point of the node; it picks which Mediapipe detector runs.
  • confidence (0–1, default 0.5) - detection threshold. Lower finds more, with more false positives.
  • strength (0–1, default 0.5) - intended as denoise. In the commented-out code it would map to the classic strength ladder: ~0.3 for subtle fixes, 0.6+ for real changes.
  • prompt / negative_prompt - what the inpainted region would be told to be.
  • guidance_scale (default 7) and blur_factor (default 0) - leave them alone; the former only matters if inpainting ever gets wired back in, and the latter crashes.

Outputs are Inpainted (IMAGE) and Annotated (IMAGE) - the detection-overlay view is genuinely handy for debugging, honestly the only part that works as labeled.

Installing it

Install like any custom node - ComfyUI Manager (search "mihaiiancu/Inpaint") or:

cd ComfyUI/custom_nodes
git clone https://github.com/mihaiiancu/ComfyUI_Inpaint

Restart ComfyUI. There's no requirements.txt in the repo, so nothing auto-installs: you need mediapipe, opencv-python, and diffusers in your ComfyUI environment yourself. Note the inpaint_model input is typed as a ComfyUI MODEL but the code expects a diffusers StableDiffusionInpaintPipeline (the commented reference is runwayml/stable-diffusion-inpainting). Another sign of the half-finished state - pipe any checkpoint in and it won't matter, because nothing calls it.

The honest verdict

If you want a fixed face in ComfyUI today, this isn't the place to start. Reach for Impact Pack's FaceDetailer (the ComfyUI side of ADetailer), or a crop-and-stitch workflow with an edit model like Qwen-Image-Edit - the KB's inpainting essay makes a strong case that mask-based inpainting's days as the default are over. This node is a curio: a neat architecture demo that never got its engine installed. If you're curious about Mediapipe-based detection it's fun to poke at, and the Annotated output is a quick way to see what the detector sees. Just don't expect regenerated pixels.

Categoryimage/postprocessing

Inputs (10)

NameTypeDefaultDescription
inpaint_modelMODEL
imageIMAGE
inpaint_typeCOMBO3 options: face, hand, body
promptSTRING
negative_promptSTRING
strengthFLOAT0.500–1
guidance_scaleFLOAT7.00–50
confidenceFLOAT0.500–1
match_colorCOMBO2 options: True, False
blur_factorINT00–200

Outputs (2)

NameTypeDescription
InpaintedIMAGE
AnnotatedIMAGE