ComfyUI Node
CV Roll (FFT Shift)
Cyclically shifts an array: pixels pushed off one edge re-enter on the opposite edge (numpy.roll on the spatial axes; channels are never mixed). The fftshift mode swaps quadrants so cv2.dft's zero-frequency term moves from the top-left corner to the center - the layout every spectrum figure uses and the one to build centered frequency masks in; ifftshift undoes it exactly (they differ on odd sizes). Custom mode rolls by an explicit (shift_x, shift_y).
CV Roll (FFT Shift)
- array
- array
◄modefftshift (center the zero frequency)►
◄shift_x0►
◄shift_y0►
Categoryimage/CV/low-level
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| array | COMFY_MATCHTYPE_V3 | Array to roll (any dtype; a DFT spectrum, an image, a mask...). The output echoes this input's format. A LATENT link is processed in latent space: frame 0 becomes a float32 [H,W,C] array (any channel count), values untouched. Arithmetic ops (add, multiply, etc.) also accept a full LATENT batch ({samples: [B,C,H,W]}) — the whole batch flows through when both inputs have the same batch size. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size. | |
| mode | COMBO | fftshift (center the zero frequency) | fftshift/ifftshift compute the half-size shifts from the array itself; custom uses shift_x/shift_y. |
| shift_x | INT | 0-2147483648–2147483647 | Custom mode only: columns to roll right (negative = left). Ignored by fftshift/ifftshift. |
| shift_y | INT | 0-2147483648–2147483647 | Custom mode only: rows to roll down (negative = up). Ignored by fftshift/ifftshift. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| array | COMFY_MATCHTYPE_V3 | The rolled array, in the same format the input arrived in. |