CLAHE Enhancement
The single most useful contrast trick in this pack
- image
- IMAGE
CLAHE Enhancement is the node I'd actually reach for first from this pack. Contrast Limited Adaptive Histogram Equalization is the old, reliable way to make faint local contrast pop - and a semi-transparent watermark over a busy photo is exactly a local-contrast problem. CLAHE doesn't just brighten the whole frame; it equalizes contrast tile-by-tile, so a pale logo on a bright sky and a dark one in shadow both get lifted where they sit.
It's also one of those tools that outgrows its label. Yes, it's here for watermarks, but it's a perfectly good general-purpose "make my flat image snap" node - and it's the technique baked into both WatermarkEnhancement and ComprehensiveImageEnhancement, so understanding it teaches you half the pack.
How it works
The mechanism is standard OpenCV, which means it's grounded and boring in the best way. The node converts your image from RGB to LAB, splits out the L (lightness) channel, and runs cv2.createCLAHE on it with your clip_limit and grid_size, then merges and converts back to RGB. Working in LAB means color is untouched - only luminance gets the treatment, so you don't get the color-shift nasties that naive global equalization produces.
The two inputs that matter
clip_limit(0.1–10, default 3) - how aggressively contrast can be boosted within a tile before it's clipped. Low values are subtle; high values can look crunchy and amplify noise. 2–4 is the sane zone for watermark hunting.grid_size(2–16, default 8) - the tile grid isgrid_size × grid_size. Smaller tiles mean more local, more aggressive adaptation (great for finding small marks, prone to halos); larger tiles behave more like global equalization. 8 is a fine start.
Output is an IMAGE tensor. Wire it to a preview or Save Image. A common workflow: CLAHE to expose the mark, then mask and inpaint it away - that's the community-standard watermark removal path, and this node is the "see it first" step.
Where people get burned
Blasting clip_limit to 10 on a smooth or already-clean image just manufactures noise - sky gradients turn into banding artifacts. And CLAHE amplifies whatever noise is already there, so if your source is a JPEG mess, run the pack's DenoisingFilter first or expect a speckly result. One more thing: the output stays a full-color image, not a mask - if you want a binary mask of the mark, threshold it afterward (the pack has Adaptive Thresholding logic inside ComprehensiveImageEnhancement, or use AdvancedWaveletWatermarkEnhancement's mask path).
Installing
No models, no GPU needed - plain CPU OpenCV:
cd ComfyUI/custom_nodes
git clone https://github.com/hotpizzatactics/ComfyUI-WaterMark-Detector
Or search ComfyUI-WaterMark-Detector in ComfyUI Manager. The pack's install.py pip-installs torch, numpy, opencv-python, scipy, and PyWavelets; you almost certainly already have opencv. Restart ComfyUI after installing and you'll find the node under image/watermark.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| clip_limit | FLOAT | 3.00.1–10 | — |
| grid_size | INT | 82–16 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |