Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Make --cpu have priority over everything else.

comfyanonymousee46bef03a98
diff --git a/comfy/model_management.py b/comfy/model_management.py
index 482b1add9..c26d682f7 100644
--- a/comfy/model_management.py
+++ b/comfy/model_management.py
@@ -50,8 +50,6 @@ if "--use-pytorch-cross-attention" in sys.argv:
XFORMERS_IS_AVAILBLE = False
-if "--cpu" in sys.argv:
- vram_state = CPU
if "--lowvram" in sys.argv:
set_vram_to = LOW_VRAM
if "--novram" in sys.argv:
@@ -73,6 +71,8 @@ if set_vram_to == LOW_VRAM or set_vram_to == NO_VRAM:
total_vram_available_mb = (total_vram - 1024) // 2
total_vram_available_mb = int(max(256, total_vram_available_mb))
+if "--cpu" in sys.argv:
+ vram_state = CPU
print("Set vram state to:", ["CPU", "NO VRAM", "LOW VRAM", "NORMAL VRAM", "HIGH VRAM"][vram_state])