We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4776ea commit d92ce14Copy full SHA for d92ce14
modules/import_hook.py
@@ -3,3 +3,14 @@
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
+# Hack to fix a changed import in torchvision 0.17+, which otherwise breaks
8
+# basicsr; see https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/13985
9
+try:
10
+ import torchvision.transforms.functional_tensor # noqa: F401
11
+except ImportError:
12
+ try:
13
+ import torchvision.transforms.functional as functional
14
+ sys.modules["torchvision.transforms.functional_tensor"] = functional
15
+ except ImportError:
16
+ pass # shrug...
0 commit comments