Skip to content

Commit 5a87757

Browse files
Better error if sageattention is installed but a dependency is missing. (Comfy-Org#8264)
1 parent 464aece commit 5a87757

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

comfy/ldm/modules/attention.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020
if model_management.sage_attention_enabled():
2121
try:
2222
from sageattention import sageattn
23-
except ModuleNotFoundError:
24-
logging.error(f"\n\nTo use the `--use-sage-attention` feature, the `sageattention` package must be installed first.\ncommand:\n\t{sys.executable} -m pip install sageattention")
23+
except ModuleNotFoundError as e:
24+
if e.name == "sageattention":
25+
logging.error(f"\n\nTo use the `--use-sage-attention` feature, the `sageattention` package must be installed first.\ncommand:\n\t{sys.executable} -m pip install sageattention")
26+
else:
27+
raise e
2528
exit(-1)
2629

2730
if model_management.flash_attention_enabled():

0 commit comments

Comments
 (0)