Nodes/ComfyUI_KimNodes/🍒Filter🎨滤镜
ComfyUI Node

🍒Filter🎨滤镜

Sharpen, dehaze, CLAHE, saturation, gamma

By wjl0313·Created 2 years ago·Updated 11 months ago· 54
🍒Filter🎨滤镜
  • image
  • IMAGE
UM非锐化掩蔽1.20
DCP暗通道先验0.32
CLAHE对比度增强限制0.00
自然饱和度1.10
伽马值1.10

KimFilter is the "my render came out a little flat, fix the whole thing in one node" button. Instead of chaining five separate color-correction nodes - and hoping their ordering and value ranges play nice together - you feed it an image, twiddle five sliders, and it runs a fixed pipeline: unsharp masking, dark-channel-prior dehazing, CLAHE contrast, natural saturation, and gamma. It's the kind of node you drop between a VAE decode and a Save Image when the result is slightly hazy, slightly soft, slightly desaturated, and you can't be bothered to debug which of those is the problem.

How it works

The processing order is baked in: sharpen → dehaze → CLAHE → saturation → gamma, applied per image in your batch (it loops over the whole batch, so it's fine to feed it a stack of frames). The interesting part is the dehaze. It's a proper Dark Channel Prior implementation - it computes the dark channel of the image, estimates atmospheric light from the brightest pixels, builds a transmission map, refines it with a guided-filter-style box filter, and recovers the scene. That's real dehazing math, not a "clarity" slider pretending to be one. The sharpen is classic unsharp masking: blur the image, blend the difference back in, with a slight brightness dip so sharpening doesn't blow out highlights. The natural saturation works in HSV on the saturation channel rather than naively multiplying RGB, and gamma is a plain LUT.

Set a slider to 0 (or 1 for gamma) and that stage is effectively skipped, so you can use it as a two-stage filter just as easily as a five-stage one.

The inputs that matter

The widget names are Chinese, straight from the author - this pack isn't translated.

  • UM非锐化掩蔽 (unsharp masking), default 1.2, range 0–3. Sharpening strength. 0 disables it.
  • DCP暗通道先验 (dark channel prior), default 0.32, range 0–1. Dehaze strength. 0 disables it - and this is the stage to watch, because DCP is the slow one. The transmission refinement uses radius-76 box filters; on a large image it's a noticeable chunk of the runtime.
  • CLAHE对比度增强限制, default 0, range 0–1. The CLAHE clip limit. Left at 0 it skips contrast enhancement entirely.
  • 自然饱和度 (natural saturation), default 1.1, range 0–2. 1.0 is neutral.
  • 伽马值 (gamma), default 1.1, range 0.1–3. Above 1 brightens midtones.

Output is a single IMAGE of the same shape as the input. Wire it straight into a preview or Save Image.

Installation

It ships inside ComfyUI_KimNodes (search "KimNodes" in ComfyUI Manager, or clone it):

cd ComfyUI/custom_nodes
git clone https://github.com/wjl0313/ComfyUI_KimNodes

Then restart ComfyUI. KimFilter itself only needs OpenCV (cv2), numpy and torch - all already floating around in any working ComfyUI install, so this node tends to "just work" even when the pack's YOLO nodes are still fighting you about dependencies.

Common issues

The one real trap: the dehaze stage changes overall brightness, especially the shadows, because the recovery formula lifts dark pixels toward atmospheric light. If your image comes back looking lifted or slightly milky, that's DCP doing its thing - drop the 暗通道先验 slider toward 0.1 or turn it off. Also, because the pipeline is fixed-order, you can't reorder stages; if you want CLAHE before dehaze, this node won't do it, and you'll reach for a pair of WAS nodes instead.

For a pack with zero Reddit footprint, the code is refreshingly solid here - the algorithm choices are real image-processing staples, and the batch loop means it behaves predictably on video frames. It's not a miracle worker; it's a well-built Swiss army knife for the "almost good" image.

Category🍒 Kim-Nodes/🎨Filter | 滤镜

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
UM非锐化掩蔽FLOAT1.200–3
DCP暗通道先验FLOAT0.320–1
CLAHE对比度增强限制FLOAT0.000–1
自然饱和度FLOAT1.100–2
伽马值FLOAT1.100.1–3

Outputs (1)

NameTypeDescription
IMAGEIMAGE