A RIFE real-time video frame interpolation plugin for TouchDesigner.
Generates intermediate frames between two frames using AI to create slow motion, frame interpolation, and time remapping effects.
- Real-time frame interpolation based on RIFE v4.9
- ONNX Runtime GPU acceleration (CUDA / TensorRT)
- Arbitrary Timestep interpolation support — generate any point between 0.0 (Frame A) and 1.0 (Frame B)
- Script TOP based — drop-in usage via
.tox - Automatic resolution padding (pads to multiples of 32, restores original size on output)
| Item | Minimum | Recommended |
|---|---|---|
| TouchDesigner | 2025.30000+ | Latest build |
| GPU | NVIDIA GTX 1060 (CUDA) | RTX 3060+ |
| VRAM | 4GB | 8GB+ |
| Python packages | onnxruntime-gpu, numpy |
— |
Note: On Mac (Apple Silicon), only CPU mode is available due to lack of CUDA. Real-time performance requires an NVIDIA GPU.
In terminal:
cd TD-RIFE
python scripts/download_model.pyOr download manually from HuggingFace:
- File:
rife49_ensemble_True_scale_1_sim.onnx(21.5MB) - Save to:
models/folder
You need to install onnxruntime-gpu in TouchDesigner's Python environment.
Method A: TDPyEnvManager (built into TD 2025)
# In TD Textport:
import subprocess, sys
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'onnxruntime-gpu'])
Method B: From system terminal
# Find TD's Python path and install directly
# Windows example:
"C:\Program Files\Derivative\TouchDesigner\bin\python.exe" -m pip install onnxruntime-gpu
# macOS example (CPU only):
/Applications/TouchDesigner.app/Contents/Frameworks/Python.framework/Versions/Current/bin/python3 -m pip install onnxruntime- Right-click in the Network Editor → Add Operator → COMP → Base
- Rename to
TD_RIFE - Enter the Base COMP (double-click)
- Right-click inside → Add Operator → TOP → Script
- Rename to
script_rife - Paste the contents of
td/TDRIFE_Callbacks.pyinto the Script TOP's Callbacks DAT- Script TOP parameters → Callbacks DAT field → open the linked Text DAT and paste the code
- Prepare two frame sources for interpolation (e.g., 2 Movie File In TOPs, or Cache TOP + Delay)
- input0 (left input): Previous frame (Frame A)
- input1 (right input): Next frame (Frame B)
After creating the Script TOP, parameters are automatically generated on the Custom page:
| Parameter | Description | Default |
|---|---|---|
| Timestep | Interpolation position. 0.0=Frame A, 0.5=midpoint, 1.0=Frame B | 0.5 |
| Model Path | Absolute path to the ONNX model file | (empty — must be set) |
| Provider | Inference engine. CUDA (default), TensorRT (faster), CPU (slower) | CUDA |
| Active | Enable/disable interpolation toggle | On |
How to set Model Path:
- Enter the absolute path to
models/rife49_ensemble_True_scale_1_sim.onnx - Example:
C:/Users/username/Desktop/TD-RIFE/models/rife49_ensemble_True_scale_1_sim.onnx
For automatic model detection and dependency checking:
- Add a Text DAT to the Base COMP (
TD_RIFE) → name:text_extension - Paste the contents of
td/TDRIFE_Extension.py - Base COMP parameters → Extensions → OP:
text_extension, Name:TDRIFEExt - Run in Textport:
op('TD_RIFE').ext.TDRIFEExt.CheckDependencies() # Check packages
op('TD_RIFE').ext.TDRIFEExt.DownloadModel() # Download model
op('TD_RIFE').ext.TDRIFEExt.Setup() # Auto setup[Movie File In TOP] ──→ [Cache TOP (size=2)] ──→ frame[0] ──→ [script_rife input0]
frame[1] ──→ [script_rife input1]
Timestep: 0.5
↓
[Interpolated Frame]
- Load video with Movie File In TOP
- Buffer 2 consecutive frames with Cache TOP (Size=2)
- Connect Cache's
[0]and[1]to script_rife's input0 and input1 respectively - Animate Timestep from 0.0 to 1.0 to smoothly transition between frames
[Video Device In TOP] ──→ [Cache TOP] ──→ [Delay TOP (1frame)] ──→ input0
└─────────────────────────────────→ input1
- Capture webcam with Video Device In TOP
- Store current frame with Cache TOP
- Generate previous frame with Delay TOP (1 frame)
- Connect both frames to script_rife
Generate multiple interpolated frames with different Timestep values:
script_rife_1 (Timestep=0.25) ──→ [Switch TOP]
script_rife_2 (Timestep=0.50) ──→ ↓
script_rife_3 (Timestep=0.75) ──→ [Sequential output]
| GPU | Resolution | Expected FPS | Notes |
|---|---|---|---|
| RTX 3060 | 720p | ~30 fps | Real-time capable |
| RTX 3080 | 1080p | ~30 fps | Real-time capable |
| RTX 4090 | 1080p | ~60 fps | High performance |
| RTX 4090 | 4K | ~15 fps | Non-real-time |
| GTX 1060 | 720p | ~10 fps | Non-real-time |
Tip: Using the TensorRT Provider is ~2x faster than CUDA (engine build takes several minutes on first run).
→ Check the package installation from Step 2. You may need to restart TD.
→ onnxruntime-gpu must be installed instead of onnxruntime.
→ Verify that CUDA Toolkit is installed.
→ Check that Model Path is correctly set (absolute path). → Verify that both input TOPs are connected. → Make sure the Active toggle is On.
→ Try changing Provider to TensorRT.
→ Reduce input resolution (downscale with Resolution TOP).
→ Set Script TOP's Cook Type to "Explicit" and cook only when needed.
→ TD's built-in NumPy and onnxruntime's required version may conflict. → Using TD 2025.30000+ is recommended (TDPyEnvManager built-in).
TD-RIFE/
├── td/ # TouchDesigner files
│ ├── TDRIFE_Extension.py # Base COMP Extension (auto setup, dependency check)
│ └── TDRIFE_Callbacks.py # Script TOP callbacks (core inference logic)
├── scripts/
│ └── download_model.py # ONNX model download script
├── models/ # ONNX model storage folder (.gitignore)
│ └── rife49_ensemble_*.onnx # (download required)
├── .gitignore
└── README.md
- RIFE (Real-Time Intermediate Flow Estimation): Practical-RIFE by Zhewei Huang et al.
- ONNX Model: yuvraj108c/rife-onnx
- RIFE Paper: "Real-Time Intermediate Flow Estimation for Video Frame Interpolation" (ECCV 2022)
MIT License
TouchDesigner용 RIFE 실시간 비디오 프레임 보간 플러그인.
두 프레임 사이의 중간 프레임을 AI로 생성하여 슬로우 모션, 프레임 보간, 타임 리매핑 효과를 만듭니다.
- RIFE v4.9 기반 실시간 프레임 보간
- ONNX Runtime GPU 가속 (CUDA / TensorRT)
- 임의 시간값(Timestep) 보간 지원 — 0.0(프레임A)~1.0(프레임B) 사이 어느 지점이든 생성
- Script TOP 기반 —
.tox로 드롭인 사용 - 해상도 자동 패딩 (32의 배수로 맞춤, 출력 시 원본 크기로 복원)
| 항목 | 최소 | 권장 |
|---|---|---|
| TouchDesigner | 2025.30000+ | 최신 빌드 |
| GPU | NVIDIA GTX 1060 (CUDA) | RTX 3060+ |
| VRAM | 4GB | 8GB+ |
| Python 패키지 | onnxruntime-gpu, numpy |
— |
참고: Mac (Apple Silicon)에서는 CUDA가 없어 CPU 모드만 가능합니다. 실시간 성능은 NVIDIA GPU가 필요합니다.
터미널에서:
cd TD-RIFE
python scripts/download_model.py또는 HuggingFace에서 수동 다운로드:
- 파일:
rife49_ensemble_True_scale_1_sim.onnx(21.5MB) - 저장 위치:
models/폴더
TouchDesigner의 Python에 onnxruntime-gpu를 설치해야 합니다.
방법 A: TDPyEnvManager (TD 2025 내장)
# TD Textport에서:
import subprocess, sys
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'onnxruntime-gpu'])
방법 B: 시스템 터미널에서
# TD의 Python 경로를 찾아서 직접 설치
# Windows 예시:
"C:\Program Files\Derivative\TouchDesigner\bin\python.exe" -m pip install onnxruntime-gpu
# macOS 예시 (CPU only):
/Applications/TouchDesigner.app/Contents/Frameworks/Python.framework/Versions/Current/bin/python3 -m pip install onnxruntime- 네트워크 에디터에서 우클릭 → Add Operator → COMP → Base
- 이름을
TD_RIFE로 변경 - Base COMP 안으로 들어가기 (더블클릭)
- 안에서 우클릭 → Add Operator → TOP → Script
- 이름을
script_rife로 변경 td/TDRIFE_Callbacks.py의 내용을 Script TOP의 Callbacks DAT에 붙여넣기- Script TOP 파라미터 → Callbacks DAT 항목 → 연결된 Text DAT을 열어서 코드 붙여넣기
- 보간할 두 프레임 소스를 준비 (예: Movie File In TOP 2개, 또는 Cache TOP + 딜레이)
- input0 (왼쪽 입력): 이전 프레임 (Frame A)
- input1 (오른쪽 입력): 다음 프레임 (Frame B)
Script TOP 생성 후 Custom 페이지에 파라미터가 자동 생성됩니다:
| 파라미터 | 설명 | 기본값 |
|---|---|---|
| Timestep | 보간 위치. 0.0=프레임A, 0.5=정중앙, 1.0=프레임B | 0.5 |
| Model Path | ONNX 모델 파일의 절대 경로 | (비어있음 — 설정 필요) |
| Provider | 추론 엔진. CUDA(기본), TensorRT(빠름), CPU(느림) | CUDA |
| Active | 보간 활성화/비활성화 토글 | On |
Model Path 설정 방법:
models/rife49_ensemble_True_scale_1_sim.onnx의 절대 경로를 입력- 예:
C:/Users/username/Desktop/TD-RIFE/models/rife49_ensemble_True_scale_1_sim.onnx
자동 모델 감지와 의존성 확인을 원하면:
- Base COMP(
TD_RIFE)에 Text DAT 추가 → 이름:text_extension td/TDRIFE_Extension.py내용 붙여넣기- Base COMP 파라미터 → Extensions → OP:
text_extension, Name:TDRIFEExt - Textport에서 실행:
op('TD_RIFE').ext.TDRIFEExt.CheckDependencies() # 패키지 확인
op('TD_RIFE').ext.TDRIFEExt.DownloadModel() # 모델 다운로드
op('TD_RIFE').ext.TDRIFEExt.Setup() # 자동 설정[Movie File In TOP] ──→ [Cache TOP (size=2)] ──→ frame[0] ──→ [script_rife input0]
frame[1] ──→ [script_rife input1]
Timestep: 0.5
↓
[보간된 프레임]
- Movie File In TOP으로 영상 로드
- Cache TOP (Size=2)으로 연속 2프레임 버퍼링
- Cache의
[0]과[1]을 각각 script_rife의 input0, input1에 연결 - Timestep을 0.0~1.0으로 애니메이션하면 프레임 사이를 부드럽게 이동
[Video Device In TOP] ──→ [Cache TOP] ──→ [Delay TOP (1frame)] ──→ input0
└─────────────────────────────────→ input1
- Video Device In TOP으로 웹캠 입력
- Cache TOP으로 현재 프레임 저장
- Delay TOP (1프레임)으로 이전 프레임 생성
- 두 프레임을 script_rife에 연결
여러 Timestep 값으로 여러 보간 프레임 생성:
script_rife_1 (Timestep=0.25) ──→ [Switch TOP]
script_rife_2 (Timestep=0.50) ──→ ↓
script_rife_3 (Timestep=0.75) ──→ [순서대로 출력]
| GPU | 해상도 | 예상 FPS | 비고 |
|---|---|---|---|
| RTX 3060 | 720p | ~30 fps | 실시간 가능 |
| RTX 3080 | 1080p | ~30 fps | 실시간 가능 |
| RTX 4090 | 1080p | ~60 fps | 고성능 |
| RTX 4090 | 4K | ~15 fps | 비실시간 |
| GTX 1060 | 720p | ~10 fps | 비실시간 |
팁: TensorRT Provider를 사용하면 CUDA 대비 ~2x 빨라집니다 (첫 실행 시 엔진 빌드에 수 분 소요).
→ Step 2의 패키지 설치를 확인하세요. TD를 재시작해야 할 수 있습니다.
→ onnxruntime 대신 onnxruntime-gpu가 설치되어야 합니다.
→ CUDA Toolkit이 설치되어 있는지 확인하세요.
→ Model Path가 올바르게 설정되었는지 확인하세요 (절대 경로). → 입력 TOP 2개가 모두 연결되어 있는지 확인하세요. → Active 토글이 On인지 확인하세요.
→ Provider를 TensorRT로 변경해보세요.
→ 입력 해상도를 낮춰보세요 (Resolution TOP으로 다운스케일).
→ Script TOP의 Cook Type을 "Explicit"으로 설정하고 필요할 때만 cook하세요.
→ TD 내장 NumPy와 onnxruntime 요구 버전이 충돌할 수 있습니다. → TD 2025.30000+ 사용을 권장합니다 (TDPyEnvManager 내장).
TD-RIFE/
├── td/ # TouchDesigner 파일
│ ├── TDRIFE_Extension.py # Base COMP Extension (자동 설정, 의존성 확인)
│ └── TDRIFE_Callbacks.py # Script TOP 콜백 (핵심 추론 로직)
├── scripts/
│ └── download_model.py # ONNX 모델 다운로드 스크립트
├── models/ # ONNX 모델 저장 폴더 (.gitignore)
│ └── rife49_ensemble_*.onnx # (다운로드 필요)
├── .gitignore
└── README.md
- RIFE (Real-Time Intermediate Flow Estimation): Practical-RIFE by Zhewei Huang et al.
- ONNX 모델: yuvraj108c/rife-onnx
- RIFE 논문: "Real-Time Intermediate Flow Estimation for Video Frame Interpolation" (ECCV 2022)
MIT License