ComfyUI Node Runs on cloud

Video Motion

Measure the movement once, reuse it everywhere

By WASasquatch·Created 4 years ago·Updated a day ago· 1,864
Video Motion
  • video
  • motion_model
  • motion
  • motion_preview
  • motion_video
◄motion_resolution768►

If you only ever install one node from this pack's video family, install this one. Half the animation category in WAS Node Suite is built on the same primitive - "how did every pixel move between frame N and frame N+1" - and Video Motion is the node that computes it and hands it out. Motion Blur, Stabilize, Split Scenes, Motion Mask, Motion Trails, Reframe, Retime, Datamosh and Temporal Consistency can all measure flow for themselves, but do it once here and they share the answer.

That sharing is not just tidy. Flow measurement is the expensive part, and each node defaulting to its own pass at 768 px on the long side is a lot of redundant compute in a graph that already has several of them.

How it works

The node reduces each frame to luminance at the working size (default 768 px on the long side), then estimates forward and backward flow between each neighbouring pair. The default, with nothing wired to motion_model, is a built-in texture-based flow - classical, no weights, no download. Wire a SEA-RAFT or FlowSeek network from Video Motion Model Loader and that network does the measuring instead, which is worth it for small or fast motion where texture matching gets vague.

Every pair is then scored two ways: agreement between the forward and backward flow (consistency), and the residual mismatch after warping. Those two numbers are what everything downstream keys off - a cut is a frame pair where too few pixels agree (the constant is 0.4 shared), and a held frame is a pair whose luminance barely changes (0.5 levels of 255).

Inputs and outputs

video takes a VIDEO or a batch of IMAGE frames, at least two frames. motion_resolution is the long side the motion is measured at: 0 means the clip's own size, 512 is fastest, 768 is the default, 1280 for small, fine motion. motion_model is optional and expects the network from the loader node.

Three outputs. motion is the measurement itself - a custom type you feed to any motion node working on the same clip, at any size, because it is already in normalised units. Budget for it: roughly 3 MB per frame at 768 px, so a 120-frame clip is a few hundred megabytes of tensors held in memory. On a long clip that is a real cost, and it is the one downside of sharing versus measuring inside the node that needs it.

motion_preview is the visualisation: hue is direction, brightness is speed, black is still. Wire it to Preview Image and you get an instant read on whether the measurement makes sense - a camera pan shows up as a coherent colour field, noisy confetti means the flow is fighting you. motion_video is the same thing as a VIDEO at the clip's frame rate and with its audio, for saving or showing elsewhere.

The node is an output node (it draws a panel playing the clip beside its motion), so you can leave it hanging as a diagnostic without wiring anything downstream.

Install

ComfyUI Manager → search WAS Node Suite v3 → install → restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git

ComfyUI 0.14.0+ and Python 3.10+. The pack installs nothing itself - requirements.txt is a comment, no pip runs now or later, and optional heavy groups are opt-in one file at a time. The built-in flow needs no models. If you want the learned one, the weights belong in ComfyUI/models/optical_flow (see Video Motion Model Loader); the pack only fetches them if you set features.network: true in config.yaml.

Practical notes

Resolution is the speed/accuracy dial. 768 is a sane default. Drop to 512 for a fast preview of whether your graph will work at all, and go to 1280 only when you are chasing slow, subtle movement that a downscale would erase.

Do not compare measurements across different clips. The consistency and cut metrics assume the frames they describe are the frames you hand the next node. Feed the same clip, at any size.

A cut is not motion. If you pan fast past a hard cut, any node keying off the flow will see a wild frame pair. That is why so many of these nodes have cut handling built in - Reframe resets its path, Retime keeps cuts, Split Scenes is nothing but cuts - and it is also why motion blur through a cut wants the at_cuts control that Datamosh has.

Memory. The 3 MB-per-frame figure at 768 px is measured, not a worst case. Two hours of 4K is not what this was built for; clips of the sort H3 and Wan produce are.

CategoryWAS Suite/Animation

Inputs (3)

NameTypeDefaultDescription
videoVIDEO,IMAGEThe clip, as a VIDEO or a batch of IMAGE frames, at least two frames.
motion_resolutionINT7680–4096Long side, in pixels, the motion is measured at: 0 = the clip's own size; 512 = fastest; 768 = default; 1280 = small, fine motion.
motion_modeloptWAS_MOTION_MODELA SEA-RAFT or FlowSeek network from Video Motion Model Loader to measure the motion with. Empty = the built-in texture flow.

Outputs (3)

NameTypeDescription
motionWAS_MOTIONThe measured motion, for any motion node fed this same clip, at any size. Holds about 3 MB per frame at 768 px.
motion_previewIMAGEThe motion per frame at the measured size: hue is direction, brightness is speed, black is still.
motion_videoVIDEOmotion_preview as a clip at the clip's frame rate and with its audio, for saving or showing elsewhere.