RIFE
RIFE (Practical-RIFE 4.25, 4.26 and 4.25 lite, Huang et al.): makes the frame between two video frames from the optical flow it estimates between them, for slow motion and higher frame rates. MIT code and weights.
experimental Fork of hzwer/Practical-RIFE@bbfd2ea · backends: portable, kernels
- Paper Real-Time Intermediate Flow Estimation for Video Frame Interpolation ECCV 2022 · first released 12 Nov 2020
Paper 2020 Added in 0.2.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import interpolation
model = interpolation.load("rife-4.25") # kernels on a supported GPU, else portable PyTorch
result = model(frame1, frame2)
result.frame
result.backend # what ran: mode, device, dtype, kernels fastforks bench rife-4.25 Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
Input: synthetic, 1080x1920 (the task’s standard size)
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | not measured | – | – | – | – |
| Original fp16the authors' mixed-precision option (float16); upstream Practical-RIFE Model.inference, timestep 0.5, zero pad to 128, inference_video.py --fp16: half default dtype, model and input | fp16 | 24.5 | – | 987 MiB/1,154 MiB | 0.2 | 0.08 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 25.0 | 0.98× | 755 MiB/894 MiB | 0.2 | 0.45 |
| Kernels | fp16 | 21.4 | 1.1× | 848 MiB/916 MiB | 0.5 | 0.20 |
| Portable + torch.compile | 44.9 | 0.55× | 1,094 MiB/1,234 MiB | 36 (build) | – | |
| TensorRT fp16 | fp16 | 17.6 | 1.4× | 562 MiBenginenot comparable | 56 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-13 to 2026-11-15. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14 | Original | fp32 | 169 | 3,588 MiB process | – | 1080x1920 |
| Portable | fp16 | 106 | 2,482 MiB process | matches | 1080x1920 | |
| Portable | fp32 | 119 | 2,481 MiB process | matches | 1080x1920 | |
| Kernels | fp16 | not implemented | – | 1080x1920 | ||
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Commercial use allowed
Our reading of the licences, not legal advice.
Weights
rife-4.25-flownet.pkl 24.6 MB· inside a 22.9 MB archive· hosted on Google Drivefastforks downloads and checks these files on first use (fastforks download rife-4.25).
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
DAVIS 2017 480p
2 frame triplets per video (180), PSNR / SSIM
| Run | dtype | psnr ↑ | ssim ↑ | Δ psnr vs fp32 original | triplets | ms / triplet |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 27.13 | 0.8082 | reference | 180 | – |
| Original fp16 | fp16 | 27.03 | 0.8074 | −0.10 | 180 | – |
| Portable fp32 | fp32 | 27.13 | 0.8082 | ±0.00 | 180 | – |
| Portable | fp16 | 27.13 | 0.8081 | ±0.00 | 180 | – |
| Kernels | fp16 | 27.13 | 0.8081 | ±0.00 | 180 | – |
DAVIS 2017 trainval 480p (JPEG), frames 0 / 2 and 20 / 22 of each of the 90 videos give the frame 1 / 21 at time 0.5, compared with the real one: PSNR and SSIM (Gaussian 11 x 11, sigma 1.5) of the output rounded to uint8, on RGB in [0, 1], averaged over the triplets for the 180-triplet benchmark. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks dc38c37c, 2026-11-17; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 5b3a5646, 2026-11-13.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.00024 and p99 <= 0.0013 (absolute error of the output frame).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.0001 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.00024 | 0.00016 |
| GPU default dtypes, p99 |diff| | ≤ 0.0013 | 0.00083 |
Recorded for rife-4.25 on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13, with these kernels: cudnn_hacc
Details
RIFE (Huang et al., ECCV 2022), the Practical-RIFE 4.25 / 4.26 releases: real-time video frame interpolation. A small conv encoder gives 4-channel features of both frames; five IFBlocks (two stride-2 convs, 8 residual convs, a transposed conv) estimate the flow from the intermediate frame to both inputs and a fusion mask, coarse to fine from 1/16 of the image to full size; the frame is both inputs warped to the time and blended by the mask. Any time in [0, 1]. `rife-4.25` is the authors' recommended default, `rife-4.26` the next release, `rife-4.25-lite` a narrower last block for lower cost.
- Input / output
- Input: two RGB images (consecutive frames). Output: the frame between them at
timestep(0.5 by default; 0 = the first, 1 = the second), RGB in [0, 1]. - Input size
- any H x W >= 128, padded to a multiple of 128; tested up to 3000x4000 (5,639 MiB allocated)
- Options
cuda_graphs=true
- Outputs
frame- CUDA kernels
cudnn_haccconvolutions with fp16 accumulation (cuDNN)
- Apple (MPS)
- fp32, fp16
Full reference, generated from the repository
RIFE (Practical-RIFE 4.25, 4.26 and 4.25 lite, Huang et al.): makes the frame between two video frames from the optical flow it estimates between them, for slow motion and higher frame rates. MIT code and weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
rife-4.25 | synthetic (1080x1920) | original portable kernels portable + torch.compile TensorRT fp16 | 24.5 25.0 21.4 44.9 17.6 | 987 / 1154 755 / 894 848 / 916 1094 / 1234 696 / 714 |
rife-4.26 | synthetic (1080x1920) | original portable kernels portable + torch.compile TensorRT fp16 | 24.2 25.1 21.4 44.5 17.6 | 1004 / 1154 755 / 894 848 / 916 1094 / 1234 696 / 714 |
rife-4.25-lite | synthetic (1080x1920) | original portable kernels portable + torch.compile TensorRT fp16 | 21.3 21.1 18.3 42.3 14.1 | 1012 / 1214 754 / 854 834 / 896 1061 / 1374 696 / 714 |
Details
- Original code: https://github.com/hzwer/Practical-RIFE at
bbfd2ea90910 - Code licence: MIT (permissive); files:
LICENSE - Weights licence: MIT
- Licence evidence: https://github.com/hzwer/Practical-RIFE/blob/bbfd2ea90910789a860ea3e2b32a240cd577b75e/README.md ; https://github.com/hzwer/Practical-RIFE/blob/bbfd2ea90910789a860ea3e2b32a240cd577b75e/LICENSE
- Training data: Vimeo-90K (septuplets / triplets for frame interpolation) (The README does not list the training data of the 4.x releases; the RIFE paper (arXiv:2011.06294) trains on Vimeo-90K, the 4.x releases add unnamed data (anime scenes per the 4.25 release note).)
- Options:
cuda_graphs= True (speed only) - Kernel libraries:
cudnn_hacc - Variants:
rife-4.25,rife-4.26,rife-4.25-lite - Outputs: frame
- Input size: any H x W >= 128, padded to a multiple of 128
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
rife-4.253000x4000 (5.5 GiB peak allocated, 6.8 reserved);rife-4.263000x4000 (5.5 GiB peak allocated, 6.8 reserved);rife-4.25-lite3000x4000 (5.5 GiB peak allocated, 6.5 reserved) rife-4.251080x1920, first call: portable + torch.compile 36 s (cold Inductor cache), TensorRT fp16 56 s (ONNX + engine).rife-4.261080x1920, first call: portable + torch.compile 35 s (cold Inductor cache), TensorRT fp16 55 s (ONNX + engine).rife-4.25-lite1080x1920, first call: portable + torch.compile 35 s (cold Inductor cache), TensorRT fp16 50 s (ONNX + engine).rife-4.25original 1080x1920: the authors' mixed-precision option (float16); upstream Practical-RIFE Model.inference, timestep 0.5, zero pad to 128, inference_video.py --fp16: half default dtype, model and inputrife-4.26original 1080x1920: the authors' mixed-precision option (float16); upstream Practical-RIFE Model.inference, timestep 0.5, zero pad to 128, inference_video.py --fp16: half default dtype, model and inputrife-4.25-liteoriginal 1080x1920: the authors' mixed-precision option (float16); upstream Practical-RIFE Model.inference, timestep 0.5, zero pad to 128, inference_video.py --fp16: half default dtype, model and inputrife-4.25load / first call: original 1.42 s / 0.265 s, portable 0.16 s / 0.447 s, kernels 1.5 s / 0.203 srife-4.26load / first call: original 0.18 s / 0.046 s, portable 0.16 s / 0.334 s, kernels 0.29 s / 0.215 srife-4.25-liteload / first call: original 0.18 s / 0.12 s, portable 0.24 s / 0.273 s, kernels 0.6 s / 0.195 s- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
DAVIS 2017 trainval 480p (JPEG), frames 0 / 2 and 20 / 22 of each of the 90 videos give the frame 1 / 21 at time 0.5, compared with the real one: PSNR and SSIM (Gaussian 11 x 11, sigma 1.5) of the output rounded to uint8, on RGB in [0, 1], averaged over the triplets for the 180-triplet benchmark. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|
rife-4.25 | DAVIS 2017 480p, 2 frame triplets per video (180), PSNR / SSIM | 27.13 / 0.8082 | 27.03 / 0.8074 | 27.13 / 0.8081 | 27.13 / 0.8082 | 27.13 / 0.8081 | |
rife-4.26 | DAVIS 2017 480p, 2 frame triplets per video (180), PSNR / SSIM | 27.24 / 0.8131 | 27.14 / 0.8123 | 27.24 / 0.8131 | 27.24 / 0.8131 | 27.24 / 0.8131 | |
rife-4.25-lite | DAVIS 2017 480p, 2 frame triplets per video (180), PSNR / SSIM | 26.82 / 0.8011 | 26.70 / 0.8001 | 26.81 / 0.8010 | 26.82 / 0.8011 | 26.81 / 0.8010 |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 5b3a5646, 2026-11-13; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks dc38c37c, 2026-11-17; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 5b3a5646, 2026-11-13.
Parity
CPU, float32: max |diff| <= 0.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.00024 and p99 <= 0.0013 (absolute error of the output frame).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
rife-4.25 | 0.00016 / 0.00083 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400 |
rife-4.26 | 0.00015 / 0.00075 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400 |
rife-4.25-lite | 0.00015 / 0.00078 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400 |
Example output
No example rendered for this checkpoint yet.