better guide message for sageattention (#6634)

This commit is contained in:
Dr.Lt.Data 2025-02-02 23:26:47 +09:00 committed by GitHub
parent 24d6871e47
commit 0a0df5f136
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,6 @@
import math import math
import sys
import torch import torch
import torch.nn.functional as F import torch.nn.functional as F
from torch import nn, einsum from torch import nn, einsum
@ -16,7 +18,11 @@ if model_management.xformers_enabled():
import xformers.ops import xformers.ops
if model_management.sage_attention_enabled(): if model_management.sage_attention_enabled():
from sageattention import sageattn 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")
exit(-1)
from comfy.cli_args import args from comfy.cli_args import args
import comfy.ops import comfy.ops