Better error if sageattention is installed but a dependency is missing. (#8264)

This commit is contained in:
comfyanonymous 2025-05-24 03:43:12 -07:00 committed by GitHub
parent 464aece92b
commit 5a87757ef9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,8 +20,11 @@ if model_management.xformers_enabled():
if model_management.sage_attention_enabled():
try:
from sageattention import sageattn
except ModuleNotFoundError:
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")
except ModuleNotFoundError as e:
if e.name == "sageattention":
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")
else:
raise e
exit(-1)
if model_management.flash_attention_enabled():