Skip to content

Commit

Permalink
Add falback to basicr for legacy versions
Browse files Browse the repository at this point in the history
  • Loading branch information
viking1304 committed Mar 8, 2024
1 parent 3686ad9 commit 7c6cf67
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion scripts/deforum_helpers/general_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
import shutil
import hashlib
from modules.shared import opts
from modules.modelloader 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

def debug_print(message):
DEBUG_MODE = opts.data.get("deforum_debug_mode_enabled", False)
Expand Down
7 changes: 6 additions & 1 deletion scripts/deforum_helpers/upscaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@
from .frame_interpolation import clean_folder_name
from .general_utils import duplicate_pngs_from_folder, checksum
from .video_audio_utilities import vid2frames, ffmpeg_stitch_video, extract_number, media_file_has_audio
from modules.modelloader import load_file_from_url
from .rich import console

from modules.shared import opts

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

# NCNN Upscale section START
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):
print(f"Got a request to *upscale* a video using {upscale_model} at {upscale_factor}")
Expand Down
6 changes: 5 additions & 1 deletion scripts/deforum_helpers/video_audio_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@
from pkg_resources import resource_filename
from modules.shared import state, opts
from .general_utils import checksum, clean_gradio_path_strings, debug_print
from modules.modelloader import load_file_from_url
from .rich import console
import shutil
from threading import Thread
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

def convert_image(input_path, output_path):
# Read the input image
Expand Down

0 comments on commit 7c6cf67

Please sign in to comment.