Skip to content

Commit

Permalink
fix rife 4k issues and change rife 4.6 models
Browse files Browse the repository at this point in the history
  • Loading branch information
NevermindNilas committed May 28, 2024
1 parent ab779d8 commit c2f3207
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/downloadModels.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,14 @@ def modelsMap(
case "rife4.6-tensorrt":
if half:
if ensemble:
return "rife_v4.6_ensemble_fp16_op20_sim.onnx"
return "rife46_v2_ensembleTrue_op16_fp16_mlrt_sim.onnx"
else:
return "rife_v4.6_fp16_op20_sim.onnx"
return "rife46_v2_ensembleFalse_op16_fp16_mlrt_sim.onnx"
else:
if ensemble:
return "rife_v4.6_ensemble_op20_sim.onnx"
return "rife46_v2_ensembleTrue_op16_mlrt_sim.onnx"
else:
return "rife_v4.6_op20_sim.onnx"
return "rife46_v2_ensembleFalse_op16_mlrt_sim.onnx"

case "rife4.17-tensorrt":
if half:
Expand Down Expand Up @@ -388,7 +388,7 @@ def downloadModels(

if model in ["vits", "vitb", "vitl"]:
fullUrl = f"{DEPTHURL}{filename}"
elif model in ["rife4.15-tensorrt", "rife4.17-tensorrt"]:
elif model in ["rife4.15-tensorrt", "rife4.17-tensorrt", "rife4.6-tensorrt"]:
fullUrl = f"{SUDOURL}{filename}"
else:
fullUrl = f"{TASURL}{filename}"
Expand Down
1 change: 0 additions & 1 deletion src/unifiedDenoise.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import torch
import logging
import numpy as np

from spandrel import ModelLoader, ImageModelDescriptor
from .downloadModels import downloadModels, weightsDir, modelsMap
Expand Down
6 changes: 6 additions & 0 deletions src/unifiedInterpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ def __init__(
self.nt = nt
self.model = None

if self.width >= 3840 or self.height >= 2160:
if self.half:
print(yellow("UHD and fp16 are not compatible with RIFE, defaulting to fp32"))
logging.info("UHD and fp16 for rife are not compatible due to flickering issues, defaulting to fp32")
self.half = False

self.handleModel()

def handleModel(self):
Expand Down

0 comments on commit c2f3207

Please sign in to comment.