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 bug when model cannot be partially unloaded.
comfyanonymous39fb74c5bd13
diff --git a/comfy/model_management.py b/comfy/model_management.pyindex 152a76f37..a6996709b 100644--- a/comfy/model_management.py+++ b/comfy/model_management.py@@ -338,8 +338,9 @@ class LoadedModel:def model_unload(self, memory_to_free=None, unpatch_weights=True):if memory_to_free is not None:if memory_to_free < self.model.loaded_size():- self.model.partially_unload(self.model.offload_device, memory_to_free)- return False+ freed = self.model.partially_unload(self.model.offload_device, memory_to_free)+ if freed >= memory_to_free:+ return Falseself.model.unpatch_model(self.model.offload_device, unpatch_weights=unpatch_weights)self.model.model_patches_to(self.model.offload_device)self.weights_loaded = self.weights_loaded and not unpatch_weights