diff options
author | ArrowM <arrowman.6677@gmail.com> | 2023-03-22 02:13:30 +0000 |
---|---|---|
committer | ArrowM <arrowman.6677@gmail.com> | 2023-03-22 02:13:30 +0000 |
commit | 00bd271faffbdfd2988b6cfc9117c67681ee14b7 (patch) | |
tree | 03d5a77e6ebf959887194dfe2db58d6feacfb039 /modules/modelloader.py | |
parent | a9fed7c364061ae6efb37f797b6b522cb3cf7aa2 (diff) | |
download | stable-diffusion-webui-gfx803-00bd271faffbdfd2988b6cfc9117c67681ee14b7.tar.gz stable-diffusion-webui-gfx803-00bd271faffbdfd2988b6cfc9117c67681ee14b7.tar.bz2 stable-diffusion-webui-gfx803-00bd271faffbdfd2988b6cfc9117c67681ee14b7.zip |
Move `load_file_from_url`
Why?
one of the internal calls of `load_file_from_url` import cv2, which locks the cv2 site-package, which extensions may (and in our case, is) breaking the installation of some libraries. The base project should be limiting its import of unnecessary libraries when possible during the installation phase.
Diffstat (limited to 'modules/modelloader.py')
-rw-r--r-- | modules/modelloader.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/modelloader.py b/modules/modelloader.py index e351d808..522affc6 100644 --- a/modules/modelloader.py +++ b/modules/modelloader.py @@ -4,7 +4,6 @@ import shutil import importlib from urllib.parse import urlparse -from basicsr.utils.download_util import load_file_from_url from modules import shared from modules.upscaler import Upscaler, UpscalerLanczos, UpscalerNearest, UpscalerNone from modules.paths import script_path, models_path @@ -59,6 +58,7 @@ def load_models(model_path: str, model_url: str = None, command_path: str = None if model_url is not None and len(output) == 0: if download_name is not None: + from basicsr.utils.download_util import load_file_from_url dl = load_file_from_url(model_url, model_path, True, download_name) output.append(dl) else: |