ComfyUI Node

HT Moiré Removal

Strip the rainbow interference off scanned and photographed screens

By ArtHommage·Created 2 years ago·Updated about a year ago· 5
HT Moiré Removal
  • image
  • processed_image
◄resolution_scaling_factor1.00►
◄tile_size_mode1024►
◄global_normalizationtrue►
◄tile_overlap128►
◄edge_padding64►
◄median_enabledtrue►
◄median_kernel_size7►
◄butterworth_enabledtrue►
◄butterworth_a0.75►
◄butterworth_b1.25►
◄butterworth_cutoff30►
◄butterworth_order2►
◄notch_enabledfalse►
◄notch_h_spacing135►
◄notch_v_spacing200►
◄notch_size15►

Photograph a computer monitor or scan a printed magazine and you know the enemy: those wavy, color-shifting interference bands that shimmer across fine patterns. That's moiré, and it wrecks perfectly good images right before they enter your pipeline. HT Moiré Removal is the pack's dedicated de-moiré filter - a frequency-domain clean-up that targets the interference pattern while leaving the underlying image mostly alone. It's the node you reach for when your source is a scan or a screen photo and you want a clean base for further processing.

How it works

It stacks three classic filters, each toggleable:

  • Median filter (median_enabled, kernel default 7) - a spatial pass that kills small periodic noise. Cheap, first line of defense.
  • Butterworth filter (butterworth_enabled) - the frequency-domain workhorse. The image goes into the Fourier domain, a Butterworth low-pass attenuates the high-frequency band where moiré lives, and it comes back out. The butterworth_a/b (0.75/1.25) shape the filter's roll-off, butterworth_cutoff (30) sets where it starts cutting, and butterworth_order (2) controls how aggressive the cut is.
  • Notch filter (notch_enabled, off by default) - the surgical option. Screen-photo moiré isn't random; it concentrates at specific frequencies set by the pixel grid and camera angle. Notch filtering removes a band of frequencies rather than everything above a cutoff. The notch_h_spacing/notch_v_spacing (135/200) and notch_size (15) define where those bands sit. Turn this on when the Butterworth pass leaves periodic residual bands - it's the difference between "softened the whole image" and "removed the actual pattern."

Everything runs tiled for memory - tile_size_mode (1024/768/512/Conservative/Aggressive), tile_overlap (128), edge_padding (64) - with global_normalization on to keep brightness consistent across tiles, which is exactly how you avoid the seams tiled processing usually introduces. resolution_scaling_factor (default 1) lets you pre-scale spatial parameters for very large inputs. Output: processed_image, straight into a preview or the next stage.

When to use it (and when not to)

Use it on scanned illustrations, photographed screens, digitized print - sources with genuine periodic interference. Don't expect it to "fix" a jpeg-compression mosaic or sensor noise; that's a different problem (the pack's other filters, like the denoiser, are aimed there). And remember frequency filtering trades detail for clean: start with median on, Butterworth on, notch off, then enable notch only if the periodic bands survive.

Installing

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/ArtHommage/HommageTools.git
cd HommageTools && pip install -r requirements.txt

restart, or Manager → "HommageTools for ComfyUI". It uses OpenCV/numpy for the median and FFT passes, which a standard ComfyUI environment already has - no extra model files. Given the pack's "perpetually in alpha" disclaimer, re-check results after updates: frequency-domain parameter behavior is exactly the kind of thing that gets tuned between versions.

CategoryHommageTools/Filters

Inputs (17)

NameTypeDefaultDescription
imageIMAGE—
resolution_scaling_factorFLOAT1.000–2—
tile_size_modeCOMBO10245 options: 1024, 768, 512, Conservative, Aggressive
global_normalizationBOOLEANtrue—
tile_overlapINT1280–256—
edge_paddingINT640–256—
median_enabledBOOLEANtrue—
median_kernel_sizeINT73–21—
butterworth_enabledBOOLEANtrue—
butterworth_aFLOAT0.750.1–2—
butterworth_bFLOAT1.250.5–3—
butterworth_cutoffINT305–100—
butterworth_orderINT21–5—
notch_enabledBOOLEANfalse—
notch_h_spacingINT13550–200—
notch_v_spacingINT20050–300—
notch_sizeINT155–30—

Outputs (1)

NameTypeDescription
processed_imageIMAGE—