MX_KuwaharaBlur(Cartoon)
The blur that keeps edges crisp and flattens everything else
- image
- IMAGE
Kuwahara is the pack's "cartoon" blur - an edge-preserving filter that smooths out detail between edges while leaving the edges themselves sharp. Where a plain Gaussian blur smears everything, Kuwahara flattens flat areas into clean, painterly patches and keeps boundaries intact. That's why it's the standard first step toward that "oil painting / cel-shaded" look, and why the node's display name is MX_KuwaharaBlur(Cartoon).
It's part of Intersection98/ComfyUI-MX-post-processing-nodes, and it's the smart sibling of the pack's plain MX_Blur. If you want to de-noise a render without turning every hair into a smudge, this is the one.
How it works
The Kuwahara filter works by sampling four quadrants around each pixel - up-left, up-right, down-left, down-right - and computing the average color and the variance of each. The pixel takes the average from whichever quadrant has the lowest variance - i.e. the flattest, most uniform area. Since a real edge will have high variance across it, the filter naturally avoids averaging across boundaries and picks the region it belongs to. That's the whole magic: smoothness where there's nothing going on, preservation where there is.
The method input chooses how each quadrant is averaged:
mean- plain box averages. Fast, chunky, the classic cartoon look.gaussian- weighted averages via Gaussian kernels. Softer transitions, more "painted," a touch heavier on compute.
And blur_radius controls the neighborhood size the filter considers; at 0 the image passes through untouched.
The inputs that matter
image- your IMAGE tensor.blur_radius-0to31, default3. The filter window.3–5is the sweet spot for a visible-but-subtle flatting; crank it up and surfaces dissolve into smooth planes.method-meanorgaussian. Start withmeanfor the strongest cartoon effect; switch togaussianwhen you want the smoothness without the harsh "poster-paint" edges.
Output is a single IMAGE, same resolution.
Install
Standard MX pack install. ComfyUI Manager (search MX or ComfyUI-MX-post-processing-nodes), or:
cd ComfyUI/custom_nodes
git clone https://github.com/Intersection98/ComfyUI_MX_post_processing-nodes
cd ComfyUI_MX_post_processing-nodes
pip install -r requirements.txt
Restart ComfyUI; it sits under postprocessing/Filters. No models, no downloads - this one leans on OpenCV's separable filtering, which your install almost certainly has.
Where people get burned
The Kuwahara's famous weakness is its "oil painting" texture at large radii: because the quadrant choice can vary abruptly between neighboring pixels, big blur_radius values create patchy, stained-glass artifacts in smooth gradients (sky, skin, walls). That's not a bug - it's the filter's signature. If you see it, back the radius off or switch to gaussian. Second, it's per-frame and not trivial to compute: on high-resolution images it's noticeably slower than the pack's plain blur, so for a subtle de-noise it's often overkill versus MX_Blur at low sigma. The sweet spot is when you want the painterly flattening - run it ahead of a MX_Posterize and you've got a very credible stylized-illustration pipeline in two nodes.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| blur_radius | INT | 30–31 | — |
| method | COMBO | 2 options: mean, gaussian |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |