OpenCV inpaint_1
Inpaint_1 — the same classical inpaint, because OpenCV listed it twice
- src
- inpaintMask
- dst
- nparray
inpaint_1 is inpaint_0 with a different number on it. This pack generates one node per OpenCV function overload, inpaint is listed twice in the stub, and both generated classes call the same cv2.inpaint(src, inpaintMask, inpaintRadius, flags, dst) with the same arguments. Identical inputs, identical output, no behavioral difference. Use either; the inpaint_0 article is the full story.
The story, briefly: this is classical, deterministic inpainting - not the diffusion kind. You feed it an image and a mask marking the pixels to remove (text, watermark, date stamp, dust, scratch), and it fills the masked region by propagating the surrounding texture inward. No model, no VRAM, deterministic result, instant. That makes it the right tool for small defects on fairly uniform backgrounds, and the wrong tool for regenerating complex content. For a missing eye or a complex object, you want masked diffusion inpainting (Flux Fill, SDXL inpaint) where a model invents detail; for a watermark, cv2.inpaint is faster and can't "reimagine" the rest of your image. The KB's guidance is worth internalizing: deterministic pixel ops beat a diffusion pass for jobs that are really just pixel ops.
Inputs. src (NPARRAY) - the image, BGR uint8. inpaintMask (NPARRAY) - single-channel mask where white marks the region to fill. inpaintRadius (FLOAT) - the sampling radius; OpenCV's default is 3, small text wants 2–4, larger areas want more. flags (INT) - 1 (INPAINT_TELEA, fast marching, the usual pick) or 0 (INPAINT_NS, Navier-Stokes). dst is the optional out-parameter - leave it unwired.
Output. One nparray (NPARRAY) - the repaired image; Nparrays2Image converts it back.
Installing. ComfyUI Manager → search "opencv-comfyui", or:
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-python-contrib
Restart ComfyUI; it's under image/OpenCV.
Where people get burned. The mask has to be a single-channel NPARRAY, not a ComfyUI MASK tensor - convert it, and match the channel count with cvtColor (6 = BGR2GRAY) if OpenCV asserts (img.type() == CV_8UC1). Batch size must be one (ImageFromBatch at length=1 if your input is a batch). And keep expectations honest: complex textures or big regions come out smeared by design. It's the same node as inpaint_0, so the _0/_1 decision is the least important thing about it.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| src | NPARRAY | — | |
| inpaintMask | NPARRAY | — | |
| inpaintRadius | FLOAT | — | |
| flags | INT | — | |
| dstopt | NPARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |