Advanced Wavelet Watermark Enhancement
The name lies — this node is actually a watermark mask maker
- image
- IMAGE
Read the name and you'd expect wavelet decomposition and detail-band boosting. Read the source and you find something else entirely. Advanced Wavelet Watermark Enhancement ships with two INPUT_TYPES definitions in the class, and in Python the second one wins - so the node that actually registers is a thresholding-and-mask-cleanup node. The wavelet code is dead. What you get instead is the pack's best tool for producing a clean binary watermark mask.
That's not a bad outcome, honestly - it just isn't what the label promises. The inputs confirm it: threshold_method (otsu / adaptive / manual), manual_threshold, block_size, constant, denoise_iterations, and edge_enhance. No wavelet knobs anywhere.
How it works
The detect_watermark method is a textbook mask pipeline:
- Convert to grayscale.
- Threshold it - Otsu, adaptive Gaussian, or a plain manual threshold - to get a binary map.
- If
denoise_iterations> 0, run open-then-close morphology (3×3 kernel) that many times to kill specks and fill holes. - If
edge_enhanceis on, Canny-detect edges on the binary and blend them back at 0.5 weight. - Output as an RGB image where the watermark region is white.
That open-then-close step is the same trick the pack's standalone MorphologicalOperations does, just baked in and looped.
The inputs that matter
threshold_method- start withotsu; it's zero-parameter and adapts to the image. Switch toadaptivewhen lighting is uneven, ormanualwhen you want to pin a specific cut.manual_threshold- only used when you pick manual; 0–255, default 127.denoise_iterations- your speckle-killer. A thresholded photo full of JPEG noise benefits from 1–3 iterations.edge_enhance- keep the mark's strokes crisp when you want the mask to trace text outlines rather than fill regions.
Output is a single IMAGE. Where it shines: a binary mask of the watermark is exactly what you need to restrict an inpainting pass (or to use as a control map). In the community's standard watermark-removal flow - mask, then inpaint with something like Flux Fill - this node is the mask stage. Canny-style edge maps like this also feed ControlNet preprocessors if you're going that route.
The gotcha
If you came looking for wavelet enhancement, you will not find it here. The pywt.wavedec2 code exists in the class body but is unreachable - the override killed it. For actual wavelet-based enhancement (detail coefficients scaled, then inverted), use the pack's AdvancedWatermarkEnhancement with method: wavelet. If you want a binary mask, use this node. Different jobs, and the naming only confuses them.
Installing
Nothing unusual - no models, CPU-only classical CV:
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 pulls in torch, numpy, opencv-python, scipy, and PyWavelets. Restart ComfyUI after installing. It's arbitrary Python at import time like every custom node, but there's no network code and no model files here - about as low-risk as this ecosystem gets.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| threshold_method | COMBO | 3 options: otsu, adaptive, manual | |
| manual_threshold | INT | 1270–255 | — |
| block_size | INT | 113–99 | — |
| constant | INT | 2-10–10 | — |
| denoise_iterations | INT | 20–10 | — |
| edge_enhance | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |