aboutsummaryrefslogtreecommitdiff
path: root/modules/import_hook.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-01-04 19:56:35 +0300
committerGitHub <noreply@github.com>2023-01-04 19:56:35 +0300
commiteeb1de4388773ba92b9920a4f64eb91add2e02ca (patch)
tree22f5d5e7417f24599a415fd64c9f1652495ce5a3 /modules/import_hook.py
parentd85c2cb2d59f64cbb510a9e5596596de2e4f4dcc (diff)
parentb7deea47eeb033052062621b0005d4321b53bff7 (diff)
Merge branch 'master' into gradient-clipping
Diffstat (limited to 'modules/import_hook.py')
-rw-r--r--modules/import_hook.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/import_hook.py b/modules/import_hook.py
new file mode 100644
index 00000000..28c67dfa
--- /dev/null
+++ b/modules/import_hook.py
@@ -0,0 +1,5 @@
+import sys
+
+# this will break any attempt to import xformers which will prevent stability diffusion repo from trying to use it
+if "--xformers" not in "".join(sys.argv):
+ sys.modules["xformers"] = None