This commit is contained in:
comfyanonymous
2023-07-02 11:57:36 -04:00
parent ae948b42fa
commit 103c487a89
2 changed files with 7 additions and 8 deletions

View File

@@ -16,11 +16,14 @@ if model_management.xformers_enabled():
import xformers
import xformers.ops
# CrossAttn precision handling
import os
_ATTN_PRECISION = os.environ.get("ATTN_PRECISION", "fp32")
from comfy.cli_args import args
# CrossAttn precision handling
if args.dont_upcast_attention:
print("disabling upcasting of attention")
_ATTN_PRECISION = "fp16"
else:
_ATTN_PRECISION = "fp32"
def exists(val):
return val is not None