update readme + logging
This commit is contained in:
@@ -46,7 +46,7 @@ class RifeTensorrt:
|
||||
|
||||
def return_middle_frame(frame_0, frame_1, timestep):
|
||||
timestep_t = torch.tensor([timestep], dtype=torch.float32).to(get_torch_device())
|
||||
output = engine.infer({"img0": frame_0, "img1": frame_1, "timestep": timestep_t}, cudaStream, use_cuda_graph)
|
||||
output = engine.infer({"img0": frame_0, "img1": frame_1, "timestep": timestep_t}, cudaStream)
|
||||
result = output['output']
|
||||
return result
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
# ComfyUI Rife TensorRT ⚡
|
||||
|
||||
[](https://www.python.org/downloads/release/python-31211/)
|
||||
[](https://developer.nvidia.com/cuda-downloads)
|
||||
[](https://developer.nvidia.com/tensorrt)
|
||||
[](https://www.python.org/downloads/release/python-3123//)
|
||||
[](https://developer.nvidia.com/cuda-downloads)
|
||||
[](https://developer.nvidia.com/tensorrt)
|
||||
[](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en)
|
||||
|
||||

|
||||
@@ -12,11 +12,22 @@
|
||||
|
||||
</div>
|
||||
|
||||
This project provides a [TensorRT](https://github.com/NVIDIA/TensorRT) implementation of [RIFE](https://github.com/hzwer/ECCV2022-RIFE) for ultra fast frame interpolation inside ComfyUI
|
||||
## ⭐ Support
|
||||
If you like my projects and wish to see updates and new features, please consider supporting me. It helps a lot!
|
||||
|
||||
This project is licensed under [CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/), everyone is FREE to access, use, modify and redistribute with the same license.
|
||||
[](https://github.com/yuvraj108c/ComfyUI-Depth-Anything-Tensorrt)
|
||||
[](https://github.com/yuvraj108c/ComfyUI-Upscaler-Tensorrt)
|
||||
[](https://github.com/yuvraj108c/ComfyUI-Dwpose-Tensorrt)
|
||||
[](https://github.com/yuvraj108c/ComfyUI-Rife-Tensorrt)
|
||||
|
||||
If you like the project, please give me a star! ⭐
|
||||
[](https://github.com/yuvraj108c/ComfyUI-Whisper)
|
||||
[](https://github.com/yuvraj108c/ComfyUI_InvSR)
|
||||
[](https://github.com/yuvraj108c/ComfyUI-Thera)
|
||||
[](https://github.com/yuvraj108c/ComfyUI-Video-Depth-Anything)
|
||||
[](https://github.com/yuvraj108c/ComfyUI-PiperTTS)
|
||||
|
||||
[](https://www.buymeacoffee.com/yuvraj108cZ)
|
||||
[](https://paypal.me/yuvraj108c)
|
||||
|
||||
---
|
||||
|
||||
@@ -59,7 +70,7 @@ Models are automatically downloaded from [HuggingFace](https://huggingface.co/yu
|
||||
2. **Process Frames**: Insert `Right Click -> Add Node -> tensorrt -> Rife Tensorrt`
|
||||
- Connect the loaded model from step 1
|
||||
- Input your video frames
|
||||
- Configure interpolation settings (multiplier, CUDA graph, etc.)
|
||||
- Configure interpolation settings (multiplier, etc.)
|
||||
- Image resolutions between `256x256` and `3840x3840` are supported
|
||||
|
||||
## 🤖 Environment tested
|
||||
@@ -69,10 +80,10 @@ Models are automatically downloaded from [HuggingFace](https://huggingface.co/yu
|
||||
|
||||
## 🚨 Updates
|
||||
|
||||
### December 2025
|
||||
- **Automatic Model Management**: No more manual downloads! Models are automatically downloaded from HuggingFace and TensorRT engines are built on demand
|
||||
- **Improved Workflow**: New two-node system with `Load Rife Tensorrt Model` + `Rife Tensorrt` for better organization
|
||||
- **Updated Dependencies**: TensorRT updated to 10.13.3.9 for better performance and compatibility
|
||||
### 08 June 2026
|
||||
- **Automatic Model Management**: No more manual downloads! Models are automatically downloaded from HuggingFace and TensorRT engines are built on demand. [PR#14](https://github.com/yuvraj108c/ComfyUI-Rife-Tensorrt/pull/14) by [@reaperhammer](https://github.com/reaperhammer)
|
||||
- **Improved Workflow + Codebase**: New two-node system with `Load Rife Tensorrt Model` + `Rife Tensorrt` for better organization
|
||||
- **Remove cuda-python**: No more cuda installation issues on windows
|
||||
|
||||
## 👏 Credits
|
||||
|
||||
|
||||
+19
-9
@@ -7,7 +7,9 @@ import einops
|
||||
from comfy.model_management import soft_empty_cache, get_torch_device
|
||||
import numpy as np
|
||||
from comfy.utils import ProgressBar
|
||||
from colored import Fore, Back, Style
|
||||
from colored import Fore, Back, Style
|
||||
from .utilities import rife_logger
|
||||
from tqdm import tqdm
|
||||
|
||||
DEVICE = get_torch_device()
|
||||
|
||||
@@ -25,9 +27,6 @@ def load_file_from_github_release(model_type, ckpt_name):
|
||||
error_str = '\n\n'.join(error_strs)
|
||||
raise Exception(f"Tried all GitHub base urls to download {ckpt_name} but no suceess. Below is the error log:\n\n{error_str}")
|
||||
|
||||
def logger(msg):
|
||||
print(f'{Style.reset}{Fore.cyan}⚡ [Rife Tensorrt] - {msg}{Style.reset}')
|
||||
|
||||
def preprocess_frames(frames):
|
||||
return einops.rearrange(frames[..., :3], "n h w c -> n c h w")
|
||||
|
||||
@@ -45,7 +44,15 @@ def generate_frames_rife(
|
||||
out_len = 0
|
||||
|
||||
number_of_frames_processed_since_last_cleared_cuda_cache = 0
|
||||
pbar = ProgressBar(len(frames))
|
||||
pbar = ProgressBar(len(frames)-1)
|
||||
|
||||
bar_format = "[\033[94mComfyUI-Rife-Tensorrt\033[0m|\033[92mINFO\033[0m] - \033[92m{desc}: {percentage:3.0f}%|{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}]"
|
||||
progress_bar = tqdm(
|
||||
total=len(frames)-1,
|
||||
desc="Interpolating",
|
||||
bar_format=bar_format,
|
||||
disable=((len(frames)-1) == 1)
|
||||
)
|
||||
|
||||
for frame_itr in range(len(frames) - 1): # Skip the final frame since there are no frames after it
|
||||
|
||||
@@ -67,22 +74,25 @@ def generate_frames_rife(
|
||||
if number_of_frames_processed_since_last_cleared_cuda_cache >= clear_cache_after_n_frames:
|
||||
soft_empty_cache()
|
||||
number_of_frames_processed_since_last_cleared_cuda_cache = 0
|
||||
logger("Clearing cache...")
|
||||
rife_logger.info("Clearing cache...")
|
||||
|
||||
pbar.update(1)
|
||||
progress_bar.update(1)
|
||||
|
||||
|
||||
progress_bar.refresh()
|
||||
progress_bar.close()
|
||||
|
||||
# Append final frame
|
||||
output_frames[out_len] = frames[-1:]
|
||||
# Get actual frame shape from first interpolated frame (CHW format)
|
||||
actual_frame = output_frames[0]
|
||||
h, w = actual_frame.shape[1], actual_frame.shape[2]
|
||||
logger(f"done! - {out_len} total frames output at resolution: {h}x{w}")
|
||||
rife_logger.info(f"done! - {out_len} total frames output at resolution: {h}x{w}")
|
||||
out_len += 1
|
||||
|
||||
# clear cache for courtesy
|
||||
soft_empty_cache()
|
||||
logger("Final clearing cache done ...")
|
||||
rife_logger.info("Final clearing cache done ...")
|
||||
#
|
||||
res = output_frames[:out_len]
|
||||
return res
|
||||
Reference in New Issue
Block a user