diff --git a/modules/import_hook.py b/modules/import_hook.py new file mode 100644 index 00000000..7403135d --- /dev/null +++ b/modules/import_hook.py @@ -0,0 +1,5 @@ +import sys + + +if "xformers" not in "".join(sys.argv): + sys.modules["xformers"] = None diff --git a/webui.py b/webui.py index c2d0c6be..18ee5a3d 100644 --- a/webui.py +++ b/webui.py @@ -8,6 +8,7 @@ from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from fastapi.middleware.gzip import GZipMiddleware +from modules import import_hook from modules.call_queue import wrap_queued_call, queue_lock, wrap_gradio_gpu_call from modules.paths import script_path