RAFT Load Flow from EXR Channels
Import motion vectors from an EXR
- RAFT_FLOW
RAFTLoadFlowFromEXRChannels loads an optical-flow field from an EXR file instead of computing one. If you've already got motion vectors - say, rendered straight out of Blender or another 3D app - this node reads the X and Y motion out of the EXR's channels and hands you a RAFT_FLOW, the same flow type that RAFTEstimate produces.
Why load flow instead of estimating it? Precision. RAFTEstimate guesses motion from two rendered frames, and a guess can be wrong around occlusions, fast motion, or flat texture-less areas. But if your footage came from a 3D renderer, the renderer knows exactly how every pixel moved - it can export ground-truth motion vectors to an EXR's channels. Feeding that true flow into your ComfyUI graph gives you cleaner, more reliable flow-guided results than any estimate. This is the node for anyone bridging a 3D/VFX pipeline into ComfyUI.
What it actually does
It opens the EXR at path, pulls the horizontal motion from the channel you name in x_channel and the vertical from y_channel, and assembles them into a RAFT_FLOW. The two invert_ switches exist because motion-vector conventions differ between renderers - some measure Y downward, some upward, some flip the sign of one axis - so you can negate either axis to match whatever exported the file. The defaults (invert_x true, invert_y false) are a sensible starting point, but if your imported motion pushes things the wrong way, these are the knobs that fix it.
The inputs and outputs that matter
path(STRING) - the EXR file to read. This is a path on the machine running ComfyUI.x_channel/y_channel(enum: R, G, B, A; defaults R and G) - which EXR channels hold the horizontal and vertical motion. Depends on how your renderer exported them.invert_x/invert_y(enum: true/false; defaults true and false) - flip an axis to match your source's convention.
Output is a single RAFT_FLOW, interchangeable with RAFTEstimate's output - pass it to RAFTFlowToImage to visualize, or on to whatever consumes flow.
How to install it
Pack: jamesWalker55/comfyui-various. ComfyUI Manager - search Various ComfyUI Nodes by Type, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/jamesWalker55/comfyui-various
then restart. This node has a real dependency the rest of the pack doesn't - reading EXR files needs the OpenEXR Python library. The README calls this out explicitly: activate your ComfyUI Python environment and run
pip install OpenEXR
Without it, this node won't work even though the rest of comfyui_raft.py loads fine.
Common issues & troubleshooting
"OpenEXR not found" / the node errors on load or run. You skipped the pip install OpenEXR step, or installed it into the wrong Python environment. It has to go into the same environment ComfyUI runs on - a common trip-up when ComfyUI uses an embedded or venv Python rather than your system one.
Motion points the wrong way. This is almost always an axis-convention mismatch. Toggle invert_x and/or invert_y until the flow lines up with the actual motion in your footage. Different renderers disagree on which way is positive, which is exactly why these switches exist.
Wrong channels. If the flow looks like garbage, check that x_channel and y_channel actually point at the channels your renderer wrote motion into. R/G is the common default, but plenty of exporters put motion vectors elsewhere - confirm in your compositing app before blaming the node.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | — | |
| x_channel | COMBO | R | 4 options: R, G, B, A |
| y_channel | COMBO | G | 4 options: R, G, B, A |
| invert_x | COMBO | true | 2 options: false, true |
| invert_y | COMBO | false | 2 options: false, true |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| RAFT_FLOW | RAFT_FLOW | — |