diff options
author | Akiba <akiba@anzu.link> | 2022-12-24 03:17:21 +0000 |
---|---|---|
committer | Akiba <akiba@anzu.link> | 2022-12-24 03:17:21 +0000 |
commit | 13e0295ab682299e3280eb6ff28be0870f2bc57c (patch) | |
tree | 7df2e758fd5149f886caca927d2d0422f243cc74 | |
parent | 35e1017e3ea0a3ad9ec28c9b447200a70a65c0ae (diff) | |
download | stable-diffusion-webui-gfx803-13e0295ab682299e3280eb6ff28be0870f2bc57c.tar.gz stable-diffusion-webui-gfx803-13e0295ab682299e3280eb6ff28be0870f2bc57c.tar.bz2 stable-diffusion-webui-gfx803-13e0295ab682299e3280eb6ff28be0870f2bc57c.zip |
fix: xformers use importlib
-rw-r--r-- | modules/import_hook.py | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/modules/import_hook.py b/modules/import_hook.py index eb10e4fd..7403135d 100644 --- a/modules/import_hook.py +++ b/modules/import_hook.py @@ -1,18 +1,5 @@ -import builtins import sys -old_import = builtins.__import__ -IMPORT_BLACKLIST = [] - if "xformers" not in "".join(sys.argv): - IMPORT_BLACKLIST.append("xformers") - - -def import_hook(*args, **kwargs): - if args[0] in IMPORT_BLACKLIST: - raise ImportError("Import of %s is blacklisted" % args[0]) - return old_import(*args, **kwargs) - - -builtins.__import__ = import_hook + sys.modules["xformers"] = None |