diff --git a/scripts/deforum_helpers/frame_interpolation.py b/scripts/deforum_helpers/frame_interpolation.py index d46556866..2e7ece860 100644 --- a/scripts/deforum_helpers/frame_interpolation.py +++ b/scripts/deforum_helpers/frame_interpolation.py @@ -190,7 +190,11 @@ def prepare_film_inference(deforum_models_path, x_am, sl_enabled, sl_am, keep_im return interp_vid_path def check_and_download_film_model(model_name, model_dest_folder): - from basicsr.utils.download_util import load_file_from_url + try: + from modules.modelloader import load_file_from_url + except: + print("Try to fallback to basicsr with older modules") + from basicsr.utils.download_util import load_file_from_url if model_name == 'film_net_fp16.pt': model_dest_path = os.path.join(model_dest_folder, model_name) download_url = 'https://github.com/hithereai/frame-interpolation-pytorch/releases/download/film_net_fp16.pt/film_net_fp16.pt' @@ -202,7 +206,7 @@ def check_and_download_film_model(model_name, model_dest_folder): try: os.makedirs(model_dest_folder, exist_ok=True) # download film model from url - load_file_from_url(download_url, model_dest_folder) + load_file_from_url(url=download_url, model_dir=model_dest_folder) # verify checksum if checksum(model_dest_path) != film_model_hash: raise Exception(f"Error while downloading {model_name}. Please download from: {download_url}, and put in: {model_dest_folder}") diff --git a/scripts/deforum_helpers/src/rife/rife_new_gen/RIFE_HDv3.py b/scripts/deforum_helpers/src/rife/rife_new_gen/RIFE_HDv3.py index e51408af7..585d964fc 100644 --- a/scripts/deforum_helpers/src/rife/rife_new_gen/RIFE_HDv3.py +++ b/scripts/deforum_helpers/src/rife/rife_new_gen/RIFE_HDv3.py @@ -102,7 +102,11 @@ def download_rife_model(path, deforum_models_path): target_file = f"{path}.pkl" target_path = os.path.join(deforum_models_path, target_file) if not os.path.exists(target_path): - from basicsr.utils.download_util import load_file_from_url - load_file_from_url(options[path][1], deforum_models_path) + try: + from modules.modelloader import load_file_from_url + except: + print("Try to fallback to basicsr with older modules") + from basicsr.utils.download_util import load_file_from_url + load_file_from_url(url=options[path][1], model_dir=deforum_models_path) if checksum(target_path) != options[path][0]: raise Exception(f"Error while downloading {target_file}. Please download from here: {options[path][1]} and place in: " + deforum_models_path) \ No newline at end of file diff --git a/scripts/deforum_helpers/upscaling.py b/scripts/deforum_helpers/upscaling.py index e2e167723..7793e0062 100644 --- a/scripts/deforum_helpers/upscaling.py +++ b/scripts/deforum_helpers/upscaling.py @@ -119,7 +119,7 @@ def check_and_download_realesrgan_ncnn(models_folder, current_user_os): try: os.makedirs(realesrgan_ncnn_folder, exist_ok=True) # download exec and model files from url - load_file_from_url(download_url, realesrgan_ncnn_folder) + load_file_from_url(url=download_url, model_dir=realesrgan_ncnn_folder) # check downloaded zip's hash with open(realesrgan_zip_path, 'rb') as f: file_hash = checksum(realesrgan_zip_path) diff --git a/scripts/deforum_helpers/video_audio_utilities.py b/scripts/deforum_helpers/video_audio_utilities.py index 6e1dc7a40..f17068a53 100644 --- a/scripts/deforum_helpers/video_audio_utilities.py +++ b/scripts/deforum_helpers/video_audio_utilities.py @@ -401,7 +401,7 @@ def check_and_download_gifski(models_folder, current_user_os): file_path = os.path.join(models_folder, file_name) if not os.path.exists(file_path): - load_file_from_url(download_url, models_folder) + load_file_from_url(url=download_url, model_dir=models_folder) if current_user_os in ['Linux','Mac']: os.chmod(file_path, 0o755) if current_user_os == 'Mac':