Difforum · Warp (2D/3D)
The warp that actually moves your Deforum frames (2D or depth-aware 3D)
- image
- camera
- depth
- warped
- occlusion_mask
Deforum animation is a feedback loop: warp the previous frame according to the camera, re-diffuse it, repeat. Difforum Warp is the warp half of that equation - the node that actually moves an image along your camera path, Deforum-style, in either of its two modes.
2d- pure affine: in-plane translation, rotation, zoom. This is the original Deforum look, cheap and reliable, no depth needed.3d- depth-based perspective parallax: near pixels travel faster than far ones, giving real three-dimensional motion. Needs adepthIMAGE (grab one from Depth Anything V2 or similar).
The warp_mode input (follow_camera / force_2d / force_3d) decides which one runs. follow_camera inherits the 2D/3D mode baked into your DIFFORUM_CAMERA; the force options override it - handy when you have a 3D camera track but no depth map and want to fall back to affine.
The output people miss: the occlusion mask
Warp returns warped (the moved frame) and occlusion_mask - a MASK marking the holes the warp revealed (areas that were off-frame before and got dragged in). That mask is the classic Deforum feedback mechanism: feed it to a sampler so only the newly-exposed regions get re-diffused, while the rest of the frame keeps its detail. Ignore the mask and you either re-diffuse everything (texture boil) or leave the holes unhealed. This single output is what separates a proper Deforum loop from a slideshow.
Inputs worth knowing
frame- which camera step to apply (the camera is a per-frame track, so this indexes it).near/far- the depth range for 3D projection (defaults 1 and 100).invert_depth- flips the depth polarity if parallax feels backwards.translation_scale- tunes how much motion the depth translation produces, because depth estimators are non-metric. This is the knob you'll actually turn when 3D motion feels either dead or nauseating.
The README's difforum_camera_warp.json template shows it standalone: Load Image → Camera → Warp → Preview, so you can feel a camera move on a single frame before committing to a full render. The Storyboard node runs this same warp chain across the whole clip without any diffusion, to preview pacing.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/chillithebillis/Difforum.git difforum
Restart ComfyUI - console prints [Difforum] loaded N nodes (ComfyUI Manager: search "Difforum"). Deps: numpy, already in ComfyUI; pack is Python 3.12+ clean. One environment gotcha from the README: SD1.5 fp16 can produce black frames via NaN on some builds - launch with --force-fp32. Not the warp's fault, but it shows up here first because warping an all-black frame looks like a broken warp.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| camera | DIFFORUM_CAMERA | — | |
| frame | INT | 10–100000 | — |
| warp_mode | COMBO | follow_camera | 3 options: follow_camera, force_2d, force_3d |
| depthopt | IMAGE | — | |
| nearopt | FLOAT | 1.000.01–1000 | — |
| faropt | FLOAT | 100.000.02–10000 | — |
| invert_depthopt | BOOLEAN | false | — |
| translation_scaleopt | FLOAT | 1.00–100 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| warped | IMAGE | — |
| occlusion_mask | MASK | — |