The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Fix cuda getting initialized in cpu mode. (#12779)
comfyanonymous4941671b5a5c
diff --git a/comfy/model_management.py b/comfy/model_management.pyindex 809600815..ee28ea107 100644--- a/comfy/model_management.py+++ b/comfy/model_management.py@@ -1666,12 +1666,16 @@ def lora_compute_dtype(device):return dtypedef synchronize():+ if cpu_mode():+ returnif is_intel_xpu():torch.xpu.synchronize()elif torch.cuda.is_available():torch.cuda.synchronize()def soft_empty_cache(force=False):+ if cpu_mode():+ returnglobal cpu_stateif cpu_state == CPUState.MPS:torch.mps.empty_cache()