Nodes/camera-comfyUI/CameraInterpolationNode
ComfyUI Node

CameraInterpolationNode

The two-keyframe shortcut for any camera move

By Alexankharin·Created about a year ago·Updated about a month ago· 36
CameraInterpolationNode
  • initial_matrix
  • final_matrix
  • trajectory
num_steps2

Every camera-driven workflow in this pack needs a trajectory: a stack of 4×4 matrices describing where the camera is and what it's looking at, frame by frame. CameraInterpolationNode is the laziest honest way to get one - you hand it two poses and it invents everything between them. That covers a shocking amount of what people actually want to do.

The classic use is the fly-through: take a point cloud (or splat scene), give this node a start pose and an end pose, and out pops a smooth path you can feed straight into CameraMotionNode for the actual render. It's also the workhorse behind the pack's VR180 trick - feed it two poses offset by your interpupillary distance and you've got a stereo pair, which is how sbs180_workflow.json synthesizes a second eye from a single fisheye view.

How it works

The input names are exactly what they sound like: initial_matrix and final_matrix, both MAT_4X4 (ComfyUI's standard camera pose type, the same one produced by TransformToMatrix or the pose nodes). Then num_steps (default 2, up to 4096) sets how many poses the output contains.

What makes this node better than naive linear interpolation is the math under the hood. The source does proper SE(3) interpolation: the rotation is slerped as a quaternion and only the translation is lerped. That distinction is the difference between a camera that swings through weird intermediate orientations and one that smoothly rotates the shortest arc. With num_steps = 2 it just spits back your two endpoints; crank it to 60 or 120 and you get a usable animation path. Note the minimum is 2, so a single pose isn't on the table - if you only have one camera, use TrajectoryCompose to build a relative move off it instead.

The output is a single trajectory tensor of shape (num_steps, 4, 4), ready for anything downstream that eats a trajectory: CameraMotionNode for point cloud renders, RenderSplats4DVideo for splat scenes, or the video reframing workflows.

Install

Standard camera-comfyUI install - it's a light node with no extra model downloads. ComfyUI Manager → search "camera-comfyUI" → Install, or clone https://github.com/Alexankharin/camera-comfyUI into custom_nodes/ and run python install.py to pull in the optional heavy dependencies (you don't need any of them for this node alone - it's pure matrix math).

Troubleshooting

  • No trajectory appears / nothing moves: you're likely feeding it a scalar or a single matrix where a MAT_4X4 is expected. Generate both keyframes with TransformToMatrix or TransformToMatrixManual first.
  • Path feels wrong (looping or jerky): the interpolation is shortest-arc, so if your two poses are more than ~180° apart in rotation, it takes the short way around. Add an intermediate keyframe by chaining two CameraInterpolationNodes and composing with TrajectoryCompose.
  • Too many frames, too slow: num_steps multiplies your render cost directly. Start at 30–60 for a preview; only render the full 120+ when the motion is dialed in.

Save a trajectory you like with SaveTrajectory and reload it with LoadTrajectory so you don't have to rebuild keyframes every session. It's a small node, but it's the on-ramp for almost everything else in this pack.

CategoryCamera/Trajectory

Inputs (3)

NameTypeDefaultDescription
initial_matrixMAT_4X4
final_matrixMAT_4X4
num_stepsoptINT22–4096Number of poses in the output trajectory, SE(3)-interpolated between the two matrices.

Outputs (1)

NameTypeDescription
trajectoryTENSOR