1 parent c095729 commit 44ff9c2Copy full SHA for 44ff9c2
1 file changed
modules/import_hook.py
@@ -3,3 +3,15 @@
3
# this will break any attempt to import xformers which will prevent stability diffusion repo from trying to use it
4
if "--xformers" not in "".join(sys.argv):
5
sys.modules["xformers"] = None
6
+
7
8
+# Hack to fix a changed import in torchvision 0.17+, which otherwise breaks
9
+# basicsr; see https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/13985
10
+try:
11
+ import torchvision.transforms.functional_tensor # noqa: F401
12
+except ImportError:
13
+ try:
14
+ import torchvision.transforms.functional as functional
15
+ sys.modules["torchvision.transforms.functional_tensor"] = functional
16
+ except ImportError:
17
+ pass
0 commit comments