The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Handle case where swap memory query fails on windows. (#15219)
comfyanonymousf06a187f50f8
diff --git a/comfy/model_management.py b/comfy/model_management.pyindex f7351224d..e3c94c15a 100644--- a/comfy/model_management.py+++ b/comfy/model_management.py@@ -684,7 +684,11 @@ def should_free_pins_for_ram_pressure(shortfall):return Trueif psutil.virtual_memory().available < WINDOWS_PIN_EVICTION_EMERGENCY_AVAILABLE:return True- return psutil.swap_memory().percent >= WINDOWS_PIN_EVICTION_SWAP_PERCENT+ try:+ return psutil.swap_memory().percent >= WINDOWS_PIN_EVICTION_SWAP_PERCENT+ except RuntimeError as err:+ logging.warning("Could not read Windows swap usage; falling back to RAM-pressure pin eviction: %s", err)+ return Truedef ensure_pin_budget(size, evict_active=False, loaded=False):if args.high_ram: