mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-09-11 03:58:22 +00: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:
@@ -31,6 +31,16 @@ try:
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
import xformers
|
||||
import xformers.ops
|
||||
XFORMERS_IS_AVAILBLE = True
|
||||
except:
|
||||
XFORMERS_IS_AVAILBLE = False
|
||||
|
||||
if "--disable-xformers" in sys.argv:
|
||||
XFORMERS_IS_AVAILBLE = False
|
||||
|
||||
if "--cpu" in sys.argv:
|
||||
vram_state = CPU
|
||||
if "--lowvram" in sys.argv:
|
||||
@@ -159,6 +169,11 @@ def get_autocast_device(dev):
|
||||
return dev.type
|
||||
return "cuda"
|
||||
|
||||
def xformers_enabled():
|
||||
if vram_state == CPU:
|
||||
return False
|
||||
return XFORMERS_IS_AVAILBLE
|
||||
|
||||
def get_free_memory(dev=None, torch_free_too=False):
|
||||
if dev is None:
|
||||
dev = get_torch_device()
|
||||
|
Reference in New Issue
Block a user