Nodes/ComfyUI-FEnodes/RAFT Optical Flow 🌊
ComfyUI Node

RAFT Optical Flow 🌊

Computes dense optical flow between consecutive frame pairs using RAFT Large (torchvision) and returns a Middlebury-coded RGB video compatible with VACE V2V control signal inputs. Per-clip global normalisation matches VACE training conventions. max_flow_size caps internal RAFT resolution to avoid the correlation volume OOM that occurs at 2K+ input. Flow is upsampled back to the original resolution after inference. Weights download automatically to {ComfyUI}/models/raft/raft_large.pth.

By FugitiveExpert01Β·Created 5 months agoΒ·Updated 5 months agoΒ· 2
RAFT Optical Flow 🌊
  • images
  • flow_frames
β—„iters20β–Ί
β—„chunk_size4β–Ί
β—„max_flow_size768β–Ί
CategoryFEnodes

Inputs (4)

NameTypeDefaultDescription
imagesIMAGESource video frames from an upstream loader (e.g. VHS LoadVideo). Minimum 2 frames. Shape: [N, H, W, 3] float32 [0, 1].
itersINT201–32RAFT refinement iterations. Higher = more accurate flow at greater compute cost. 20 is the standard RAFT paper default.
chunk_sizeINT41–64Frame pairs per RAFT forward call. Higher = faster but more VRAM. Reduce if you hit OOM on long clips.
max_flow_sizeINT768256–2048Longer-edge resolution cap for internal RAFT processing. RAFT's correlation volume is O(HΒ²Γ—WΒ²) β€” at native 2K this is ~4.5 GB per batch item. Frames are downsampled to this size before RAFT and the resulting flow is bilinearly upsampled back to the original resolution afterwards. For a VACE control signal, 512–768 is sufficient. Set to 2048 to disable downsampling.

Outputs (1)

NameTypeDescription
flow_framesIMAGEβ€”