Nodes/ComfyUI-Spectral-Preprocessing-Nodes/Directional Artifact Suppressor
ComfyUI Node

Directional Artifact Suppressor

Energy piled up along one angle

By EdoardoGuerriero·Created 2 months ago·Updated 2 months ago· 0
Directional Artifact Suppressor
  • image
  • image
threshold_sigma3.0
attenuation0.80
angular_kernel5
min_radius0.05
n_angle_bins180
tile_size0
tile_overlap64

Checkerboard patterns, ESRGAN stripe artifacts, moiré, aliasing bands, CNN grid patterns - they all share a frequency-domain signature. Instead of scattering energy evenly across angles like a natural image does, they concentrate it along specific directions in the FFT spectrum. A checkerboard, for instance, lights up as a cross through the origin; a striped upscaler artifact shows up as a single bright line at its orientation. DirectionalArtifactSuppressor is the node in ComfyUI-Spectral-Preprocessing-Nodes that hunts those lines and quietly flattens them, before your image ever hits the VAE encoder.

It's the directional sibling of the pack's Spectral Spike Suppressor (which kills isolated points in the spectrum). If you feed an AI-upscaled image into Flux img2img and get banding, ghosting, or weird repetitive texture in the output, this is one of the first two nodes to try. The pack's recommended stacking order puts Spike Suppressor first, this one second.

How it works

The node bins the FFT magnitude into angular sectors across 0–180°, then estimates what a normal energy distribution along those angles would look like using a circular median filter - the angular_kernel controls how wide that background estimate is. Each angle gets a z-score: how far its energy sits above the expected background. Angles that flag as anomalous get a smooth sigmoid attenuation mask (never a hard cut - the pack's design rule is "smooth, never hard," to avoid Gibbs ringing), which is then mapped back onto the 2-D Cartesian frequency grid and applied to the magnitude. Phase is never modified, so edges survive exactly.

The inputs that matter

  • threshold_sigma (default 3.0) - the z-score above which a direction counts as anomalous. Lower = more aggressive. This is the main knob.
  • attenuation (default 0.8) - the maximum fraction of energy removed in flagged directions.
  • angular_kernel (default 5) - half-width of the circular median filter, in angle bins. Larger = smoother background estimate, and less sensitive to broad directional biases. Good to raise if the artifact is a wide band rather than a needle.
  • min_radius (default 0.05) - coefficients closer to DC than this are left alone entirely. That's deliberate: low-frequency directional energy is often real image content, not artifact.
  • n_angle_bins (default 180) - angular resolution. More bins = finer discrimination but noisier per-bin statistics; the README frames 180 as a fine default, and dropping it speeds things up.

As with the rest of the pack there's a tile_size / tile_overlap pair for images above ~2048px (tile_size 512–1024, overlap 64–128), and the single output image wires straight into the next node or into VAE Encode.

Installing it

It's one of sixteen nodes in the pack, all installed at once under Spectral Preprocessing in the node browser. Via ComfyUI Manager, search "ComfyUI-Spectral-Preprocessing-Nodes"; or:

cd ComfyUI/custom_nodes
git clone https://github.com/EdoardoGuerriero/ComfyUI-Spectral-Preprocessing-Nodes

Restart, and you're done. Dependencies are only numpy and scipy (both ship with ComfyUI), and there are no model downloads.

Where people get burned

The trap with any directional suppressor is that real photographs are not isotropic. A horizon, architecture, wood grain, or fabric weave all have legitimately directional energy - that's what min_radius protects the low frequencies for, and why you shouldn't hammer threshold_sigma down just because the output still looks "off." If you flatten real directionality, textures go mushy in a way that's hard to undo. The README's advice is to start with the default threshold_sigma of 3.0 and only lower it if the artifact visibly survives, and to check the FFT Spectrum Visualizer's angular-profile panel (the one that plots energy vs angle) so you're actually suppressing the spike you think you're suppressing, rather than guessing blind.

CategorySpectral Preprocessing

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
threshold_sigmaFLOAT3.00.5–15Z-score threshold for flagging an angular direction as anomalous. Lower = more aggressive.
attenuationFLOAT0.800–1Maximum fraction of energy removed in flagged directions.
angular_kernelINT51–30Half-width (in angle bins) of the circular median filter used to estimate the angular background. Larger = smoother background, less sensitive to broad directional biases.
min_radiusFLOAT0.050–0.4Minimum normalised radius included in the angular analysis. Pixels closer to DC than this are always left unmodified.
n_angle_binsINT18036–720Angular resolution of the analysis (number of bins over 0°–180°). More bins = finer directional discrimination.
tile_sizeINT00–2048Tile size for large images. 0 = process whole image.
tile_overlapINT640–512Tile overlap in pixels (used only when tile_size > 0).

Outputs (1)

NameTypeDescription
imageIMAGE