🎈LG_IFFT
LG_IFFT, the filter half of the FFT pair
- ff
- mask
- image
This is the node that actually does the work. 🎈LG_FFT converts your image to frequency space; 🎈LG_IFFT filters that spectrum and converts it back. Together they're a classical image-processing chain that lives inside ComfyUI - no model, no prompt, no risk of an AI "restorer" quietly redrawing your face while it cleans up your scan. The pack's README is blunt about the main event: low-pass filtering to kill the moiré web patterns (网纹) you get from scanning printed material.
How it works
The mechanism is honest signal processing. The node takes the complex frequency data from LG_FFT, builds a filter as a radial distance from the center of the spectrum plane, and - here's the interesting bit - multiplies that filter by the mask you feed in (combined_mask = l_mask * filter_mask). Then it applies the result to the spectrum, runs ifftshift + ifft2, takes the magnitude, and returns an IMAGE.
Three filter shapes, all straightforward:
low_pass- keeps everything below a radius. Kills high-frequency noise, scan texture, and moiré. This is the one you'll use 90% of the time. Note the quirk: the cutoff knob for low-pass ishigh_cutoff.high_pass- keeps everything above a radius; the knob islow_cutoff. Good for edge/sharpening tricks, less useful for cleanup.band_pass- keeps a band betweenlow_cutoffandhigh_cutoff, both active. For the "particular uses" the author mentions but leaves mostly to you.
This naming split is intentional and documented - low-pass only touches high_cutoff, high-pass only touches low_cutoff. It trips people up once, then never again.
The inputs that matter
ff- theFFTDataoutput from 🎈LG_FFT. The custom type, not the spectrum picture. This is the number one wiring mistake.mask(MASK) - a mask you draw or generate, multiplied against the filter to restrict where it bites. Draw it with the MaskEditor directly on your image.filter_type-low_pass/high_pass/band_pass, defaultlow_pass.low_cutoffandhigh_cutoff- INT, 0–1000, defaults 10 and 50. These are radii in pixels in the frequency plane, so on a typical megapixel image you're living in the low double digits.invert_mask- flips your mask (1 - mask). One of the author's additions over the original fssorc FFT pack, handy when you want to protect a region from filtering instead of filtering it.
The single output is image - the reconstructed result. Wire it to PreviewImage, SaveImage, or anything downstream.
Install
Same pack as LG_FFT, so if you already installed it you're done. Otherwise: ComfyUI Manager → search ComfyUI_LG_FFT, or:
cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/ComfyUI_LG_FFT
Restart ComfyUI; both nodes land in 🎈LAOGOU. No models to download, dependencies are just torch/torchvision/numpy (already in ComfyUI - cv2 is imported but not declared, and ComfyUI bundles it anyway).
Common issues
- Mask size mismatch. The mask is multiplied pointwise against the spectrum, so it must match the input image's dimensions. Draw it with the MaskEditor on the actual image and you're safe; a mask from a differently-sized LoadImage will blow up the multiply or silently do nothing useful.
- Wrong
ffinput. Feed theFFTDataoutput, not the spectrum image, or the node won't even attach. - Over-filtering = blur. A low-pass that's too aggressive (high cutoff set very low) turns everything to jelly. Start around
high_cutoff20–60 for moiré and nudge down until the pattern dies but edges survive. Mild blur is the built-in cost of low-pass - that's physics, not a bug. - It won't invent missing detail. If the whole image is damaged, this isn't the tool - that's the SUPIR/SeedVR2 territory covered elsewhere in the restoration ladder. FFT filtering removes periodic junk while preserving everything else, which is exactly why it's the right call for scan moiré.
A r/comfyui user asked in 2026 whether traditional moiré elimination in ComfyUI was even feasible, and the answers steered straight to AI upscalers. This pair is the answer to the "but I don't want the AI to touch my image" version of that question.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| ff | FFTData | — | |
| mask | MASK | — | |
| filter_type | COMBO | low_pass | 3 options: low_pass, high_pass, band_pass |
| low_cutoff | INT | 100–1000 | — |
| high_cutoff | INT | 500–1000 | — |
| invert_mask | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |