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.
RAFT Optical Flow π
- images
- flow_frames
βiters20βΊ
βchunk_size4βΊ
βmax_flow_size768βΊ
CategoryFEnodes
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Source video frames from an upstream loader (e.g. VHS LoadVideo). Minimum 2 frames. Shape: [N, H, W, 3] float32 [0, 1]. | |
| iters | INT | 201β32 | RAFT refinement iterations. Higher = more accurate flow at greater compute cost. 20 is the standard RAFT paper default. |
| chunk_size | INT | 41β64 | Frame pairs per RAFT forward call. Higher = faster but more VRAM. Reduce if you hit OOM on long clips. |
| max_flow_size | INT | 768256β2048 | Longer-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)
| Name | Type | Description |
|---|---|---|
| flow_frames | IMAGE | β |