Skip to content

Commit 7c6cf67

Browse files
authored
Add falback to basicr for legacy versions
1 parent 3686ad9 commit 7c6cf67

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

scripts/deforum_helpers/general_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
import shutil
1919
import hashlib
2020
from modules.shared import opts
21-
from modules.modelloader import load_file_from_url
21+
try:
22+
from modules.modelloader import load_file_from_url
23+
except:
24+
print("Try to fallback to basicsr with older modules")
25+
from basicsr.utils.download_util import load_file_from_url
2226

2327
def debug_print(message):
2428
DEBUG_MODE = opts.data.get("deforum_debug_mode_enabled", False)

scripts/deforum_helpers/upscaling.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@
2222
from .frame_interpolation import clean_folder_name
2323
from .general_utils import duplicate_pngs_from_folder, checksum
2424
from .video_audio_utilities import vid2frames, ffmpeg_stitch_video, extract_number, media_file_has_audio
25-
from modules.modelloader import load_file_from_url
2625
from .rich import console
2726

2827
from modules.shared import opts
2928

29+
try:
30+
from modules.modelloader import load_file_from_url
31+
except:
32+
print("Try to fallback to basicsr with older modules")
33+
from basicsr.utils.download_util import load_file_from_url
34+
3035
# NCNN Upscale section START
3136
def process_ncnn_upscale_vid_upload_logic(vid_path, in_vid_fps, in_vid_res, out_vid_res, models_path, upscale_model, upscale_factor, keep_imgs, f_location, f_crf, f_preset, current_user_os):
3237
print(f"Got a request to *upscale* a video using {upscale_model} at {upscale_factor}")

scripts/deforum_helpers/video_audio_utilities.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@
2929
from pkg_resources import resource_filename
3030
from modules.shared import state, opts
3131
from .general_utils import checksum, clean_gradio_path_strings, debug_print
32-
from modules.modelloader import load_file_from_url
3332
from .rich import console
3433
import shutil
3534
from threading import Thread
35+
try:
36+
from modules.modelloader import load_file_from_url
37+
except:
38+
print("Try to fallback to basicsr with older modules")
39+
from basicsr.utils.download_util import load_file_from_url
3640

3741
def convert_image(input_path, output_path):
3842
# Read the input image

0 commit comments

Comments
 (0)