fix: 🔥 much faster (using GPU) on windows

Linux should already work fine
This commit is contained in:
melMass
2023-07-06 20:24:05 +02:00
parent be5a655cfa
commit 2f455aaca5
2 changed files with 16 additions and 1 deletions
+10
View File
@@ -12,6 +12,8 @@ import numpy as np
import subprocess
import comfy
import tensorflow as tf
class LoadFilmModel:
"""Loads a FILM model"""
@@ -79,6 +81,14 @@ class FilmInterpolation:
film_model: interpolator.Interpolator,
):
n = images.size(0)
# check if tensorflow GPU is available
available_gpus = tf.config.list_physical_devices("GPU")
if not len(available_gpus):
log.warning(
"Tensorflow GPU not available, falling back to CPU this will be very slow"
)
else:
log.debug(f"Tensorflow GPU available, using {available_gpus}")
num_frames = (n - 1) * (2 ** (interpolate) - 1)
log.debug(f"Will interpolate into {num_frames} frames")
+6 -1
View File
@@ -8,4 +8,9 @@ mmcv==2.0.0
mmdet==3.0.0
rembg==2.0.37
facexlib==0.3.0
basicsr==1.4.2
basicsr==1.4.2
# on windows non WSL 2.10 is the last version with GPU support
tensorflow==2.10.0; platform_system == "Windows"
tensorflow; platform_system != "Windows"
# the old tf version on windows comes with a breaking protobuf version
protobuf==3.20.2; platform_system == "Windows"