Nodes/ComfyUI-WaterMark-Detector/Texture Enhancement
ComfyUI Node

Texture Enhancement

Band-pass FFT to pull fine texture — and watermarks — out of hiding

By hotpizzatactics·Created 2 years ago·Updated 2 years ago· 0
Texture Enhancement
  • image
  • IMAGE
frequency_range40
boost_factor2.5

Texture Enhancement is the frequency-domain member of the pack. Where CLAHE works in lightness and the gray node works in color, this one works in spatial frequency: it isolates a band of detail - the range of fine structures that watermarks, text strokes, and subtle texture all live in - boosts it, and adds it back onto your original.

The "texture" in the name is doing honest work. A watermark is, at the pixel level, a texture: a set of high-frequency edges overlaid on whatever's underneath. Filtering the image in Fourier space lets you grab exactly that frequency band and turn it up, which is why this node is good for marks that are nearly invisible in the spatial domain but still create edges a human eye can't pick out of a flat wash.

How it works

From the source, the pipeline is:

  1. Convert to grayscale and take the FFT (with fftshift to center it).
  2. Build a band-pass mask: a ring between frequency_range/2 and frequency_range pixels from the center gets value 1, everything else 0. Low frequencies (smooth background) and the very highest (pure noise) are both excluded.
  3. Apply the mask, inverse-FFT, normalize.
  4. Scale the extracted band by boost_factor, then add it on top of the original image and clamp.

Because the extracted band is added back to the original rather than replacing it, the output stays a recognizable color photo - just with that mid-high frequency detail turned up.

The two inputs

  • frequency_range (1–100, default 40) - the outer radius of the band in pixels. This is really a "what scale of detail do you mean" knob: small values grab tiny, tight detail; larger values grab broader structures. Default 40 is a reasonable middle.
  • boost_factor (1–5, default 2.5) - how much the extracted band gets amplified before it's added back. 2–3 is typical; past that, things get crunchy.

Output is an IMAGE tensor, same resolution as the input.

The honest caveats

This is the node most likely to make your image look "over-processed" if you're not careful. The band-pass design keeps the worst of it away, but a wide frequency_range on a busy photo is effectively a global sharpening bomb - you'll see halos around strong edges and grain everywhere. Keep the range tight and the boost modest, and preview before you commit. Also, because the source converts to grayscale for the FFT work and adds the result back to color, you can occasionally see a desaturation drift in the boosted regions; it's mild, but it's there. For the cleanest result, pair it with a denoise afterwards - the same way the pack's ComprehensiveImageEnhancement does internally.

Installing

No models, runs fine on CPU:

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

or search ComfyUI-WaterMark-Detector in ComfyUI Manager. install.py pip-installs torch, numpy, opencv-python, scipy, and PyWavelets; scipy is what supplies the FFT, and it ships with most ComfyUI setups. Restart ComfyUI after installing.

Categoryimage/watermark

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
frequency_rangeINT401–100
boost_factorFLOAT2.51–5

Outputs (1)

NameTypeDescription
IMAGEIMAGE