Nodes/ComfyUI-WaterMark-Detector/Advanced Watermark Enhancement
ComfyUI Node

Advanced Watermark Enhancement

Four classical ways to drag a faint watermark into view

By hotpizzatactics·Created 2 years ago·Updated 2 years ago· 0
Advanced Watermark Enhancement
  • image
  • IMAGE
method
strength1.0

Advanced Watermark Enhancement is a menu of four classical frequency/phase tricks for making faint marks visible: fourier, wavelet, phase_congruency, and adaptive_threshold. You pick a method, nudge one strength slider, and get back an IMAGE where the watermark should be a lot harder to miss. Think of it as the "try the other tricks" node - the pack's basic WatermarkEnhancement does CLAHE+sharpen, and this one covers the mathier approaches in a single dropdown.

Note that every method here processes the image in grayscale - the node converts to gray, works, then stacks the result back to three channels. Output is an IMAGE tensor you can preview or wire onward, but it's effectively a monochrome enhancement. Fine for watermark work, which is usually about luminance contrast anyway.

How it works, per method

From the source:

  • fourier - FFT, then zeroes out the low-frequency block (a hardcoded 30-pixel square around the DC center) and reconstructs. That's a high-pass: it kills smooth background variation and leaves edges - text strokes, logo borders - behind.
  • wavelet - a 2D DWT with the biorthogonal bior1.3 wavelet, scales the three detail subbands by strength, and inverts. Detail coefficients carry the high-frequency watermark signal.
  • phase_congruency - here's the honesty: the source comment says it's a simplified version and points you at the phasepack library for the real thing. What actually runs is Sobel gradients: magnitude * cos(phase) * strength. It's a reasonable edge-structure approximation, not true phase congruency.
  • adaptive_threshold - adaptive Gaussian thresholding, then addWeighted blends the binary map back over the original with strength. Fastest to a legible result on uneven lighting.

The one slider

strength (0.1–5.0) is the only control besides the method. It does not mean the same thing everywhere: wavelet multiplies detail coefficients by it, adaptive threshold maps it onto block size and offset, and phase_congruency scales its output. And in the fourier branch it's effectively ignored - that path is fixed at the 30-pixel cutoff regardless of strength. So if changing strength seems to do nothing, check which method you're on rather than fighting the slider.

Using it

For a beginner, the workflow is: load your image, pick fourier or wavelet, and preview. If the mark still hides, switch method before touching strength. Once it's visible, the community-standard next step is masking and inpainting - the enhanced output isn't a mask by itself, but it makes the region obvious enough to mask (and this pack's CombineEnhancements can merge it with the original). It's CPU-only classical CV, no models, so it runs anywhere.

Installing

Clone the pack, or find ComfyUI-WaterMark-Detector in ComfyUI Manager:

cd ComfyUI/custom_nodes
git clone https://github.com/hotpizzatactics/ComfyUI-WaterMark-Detector

install.py pip-installs torch, numpy, opencv-python, scipy, and PyWavelets (the wavelet method is the reason PyWavelets is in there). No model downloads, no GPU requirement. Restart ComfyUI after installing and the node appears under the image/watermark category.

One caveat worth knowing about the whole pack: the author (hotpizzatactics) has essentially no public footprint and the README is empty - this is a minimal classical-CV pack with no network calls, so it's about as benign as custom nodes get, but it's still arbitrary Python running at import time. Check the source yourself if that bugs you; it's 600 lines and easy to scan.

Categoryimage/watermark

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
methodCOMBO4 options: fourier, wavelet, phase_congruency, adaptive_threshold
strengthFLOAT1.00.1–5

Outputs (1)

NameTypeDescription
IMAGEIMAGE