Nodes/opencv-comfyui/OpenCV idft_1
ComfyUI Node

OpenCV idft_1

Idft_1 — the identical twin of idft_0, and that's fine

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV idft_1
  • src
  • dst
  • nparray
flags
nonzeroRows

Quick answer: idft_1 is idft_0 with a different name. The two nodes are byte-for-byte the same wrapper around cv2.idft - same inputs, same output, same behavior. This pack auto-generates a ComfyUI node for every top-level OpenCV function by parsing the cv2 type stubs, and when OpenCV lists a function with multiple overload signatures, the generator numbers them _0, _1, and so on. Sometimes those overloads differ meaningfully (different parameter sets); here they don't. So if you clicked this page to figure out which one to use: either. There is no reason to prefer one.

That's the whole practical difference, so the rest is about the function itself, briefly. cv2.idft is the inverse discrete Fourier transform - the reconstruction half of a frequency-domain pipeline. You'd use it after dft_0 (the forward transform in this pack) to turn a filtered spectrum back into an image. Real-world uses: removing periodic noise like moiré patterns by zeroing the offending frequency bins, or doing a notch filter on a repeating texture. Niche, but genuinely not available in any other ComfyUI pack.

Inputs. src (NPARRAY) - the spectrum from dft_0. flags (INT) - set 2 (DFT_SCALE) so the inverse properly normalizes; add 8 (DFT_REAL_OUTPUT) to get a real image back if your source is real, so commonly 10. nonzeroRows (INT) - an optimization, leave at 0. dst is an optional out-parameter; the README's advice is to leave optional dst-style parameters unwired and take the node's own nparray output, and that holds here.

Output. One nparray (NPARRAY) - the reconstructed image, ready for Nparrays2Image to turn back into a ComfyUI IMAGE.

Installing. Same as every node in this pack - ComfyUI Manager, search "opencv-comfyui", or:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-python-contrib

Restart ComfyUI; it shows up under image/OpenCV.

Where people get burned. Forgetting the scale flag gives you an overexposed reconstruction - flags = 2 (or 10) fixes it. Feeding a normal image in as src and expecting a filtered look gives you garbage; src must be an actual spectrum. And the pack's universal rule: batch size must be 1, or you'll hit the Only images with batch_size==1 are supported! error - peel frames off with ImageFromBatch at length=1.

The broader expectation-setting: this whole pack is auto-generated and raw - integer flag codes, no tooltips, "Expect dragons!" in the README. It's the real cv2 behavior with none of the polish. If you don't already know why you need an inverse Fourier transform, you don't need this node; if you do, grab either idft_0 or this one - they're the same function.

Categoryimage/OpenCV

Inputs (4)

NameTypeDefaultDescription
srcNPARRAY
flagsINT
nonzeroRowsINT
dstoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY