diff --git a/nodes/image_interpolation.py b/nodes/image_interpolation.py index bb49579..f222ad0 100644 --- a/nodes/image_interpolation.py +++ b/nodes/image_interpolation.py @@ -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") diff --git a/requirements.txt b/requirements.txt index f56dd43..73a03dc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,9 @@ mmcv==2.0.0 mmdet==3.0.0 rembg==2.0.37 facexlib==0.3.0 -basicsr==1.4.2 \ No newline at end of file +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" \ No newline at end of file