π Unroll Frames
Undo a roll even after interpolation changed the frame count
- images
- images
Roll Frames shifts where your loop starts. This is its quiet bookend: Unroll Frames puts the order back. And it handles the one case that makes a naive undo fail - when you rolled the clip, then ran it through a RIFE interpolator that multiplied the frame count, so the original offset no longer lines up with anything.
Here's the situation it exists for. Say you roll a clip by 1 to start it on a nicer frame. Now you interpolate it 2Γ - every gap gained an in-between frame, so the clip is twice as long and the frame that used to be first isn't first anymore. If you try to undo the roll with a plain shift of 1, you're off by a frame and the clip's motion is wrong for the rest of its life. Unroll Frames knows to compensate: it rotates by base_offset Γ (m+1), where m is the interpolation multiple. That extra +1 is the correction for the in-betweens that interpolation inserted into every gap.
The inputs that matter
- images - your clip after interpolation (framesβ²ΓHΓWΓC).
- base_offset - the exact offset that came out of Roll Frames'
offset_outoutput. Don't retype it; wire it. - m - how many in-betweens per gap were added, i.e. the interpolation multiple. Set 0 if no interpolation happened, and the node just becomes a plain roll-back.
Installing it
WhiteRabbit pack, installed once:
cd ComfyUI/custom_nodes
git clone https://github.com/Artificial-Sweetener/comfyui-WhiteRabbit
cd comfyui-WhiteRabbit
python -m pip install -r requirements.txt
or ComfyUI Manager β "WhiteRabbit" β install β restart. Requires a current ComfyUI (v3 node API).
Where people get burned
- Guessing
mwrong. This is the whole ballgame. If you interpolated 2Γ (one in-between per gap),mis 1, not 2. The multiply node'smultiplieris the frame count per gap after interpolation minus one - match it to the number of inserted frames, and you're aligned. - Using the wrong offset. Always wire
base_offsetfrom Roll Frames'offset_outrather than typing a number. Rolled twice by different amounts, and you'll want the exact value, not a recollection.
Used correctly, the chain is Roll Frames β interpolate β Unroll Frames, and the output has your original motion ordering back with the new smoothness intact. Without the m correction, that chain would silently corrupt the whole clip - which is why this little node earns its keep.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Clip after interpolation (framesβ²ΓHΓWΓC). | |
| base_offset | INT | 1-9999β9999 | Use the exact offset_out that came from RollFrames. |
| m | INT | 00β9999 | How many in-betweens per gap were added (the interpolation multiple). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | β |