1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Xformers is now properly disabled when --cpu used.

Added --windows-standalone-build option, currently it only opens
makes the code open up comfyui in the browser.
This commit is contained in:
comfyanonymous
2023-03-12 15:44:16 -04:00
parent 6d6758e9e4
commit 0f3ba7482f
5 changed files with 34 additions and 12 deletions

View File

@@ -12,10 +12,8 @@ import model_management
try:
import xformers
import xformers.ops
XFORMERS_IS_AVAILBLE = True
except:
XFORMERS_IS_AVAILBLE = False
print("No module 'xformers'. Proceeding without it.")
pass
try:
OOM_EXCEPTION = torch.cuda.OutOfMemoryError
@@ -315,7 +313,7 @@ class MemoryEfficientCrossAttentionWrapper(MemoryEfficientCrossAttention):
def make_attn(in_channels, attn_type="vanilla", attn_kwargs=None):
assert attn_type in ["vanilla", "vanilla-xformers", "memory-efficient-cross-attn", "linear", "none"], f'attn_type {attn_type} unknown'
if XFORMERS_IS_AVAILBLE and attn_type == "vanilla":
if model_management.xformers_enabled() and attn_type == "vanilla":
attn_type = "vanilla-xformers"
print(f"making attention of type '{attn_type}' with {in_channels} in_channels")
if attn_type == "vanilla":