From 5c106a03080b3ebe63b122ef60ba50adca53e327 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Fri, 1 Nov 2024 20:25:38 -0400 Subject: [PATCH 1/2] Run garbage collector when switching workflow if needed. --- execution.py | 1 + 1 file changed, 1 insertion(+) diff --git a/execution.py b/execution.py index 2677fb18d..768e35abc 100644 --- a/execution.py +++ b/execution.py @@ -480,6 +480,7 @@ class PromptExecutor: if self.caches.outputs.get(node_id) is not None: cached_nodes.append(node_id) + comfy.model_management.cleanup_models_gc() self.add_message("execution_cached", { "nodes": cached_nodes, "prompt_id": prompt_id}, broadcast=False) From 95972bab86e5e1b64cc9b2956299ec57845e9d19 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 4 Nov 2024 05:07:07 -0500 Subject: [PATCH 2/2] Fix issue. --- comfy/model_management.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index adda3841d..f550d1d93 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -331,7 +331,7 @@ class LoadedModel: use_more_vram = lowvram_model_memory if use_more_vram == 0: use_more_vram = 1e32 - self.model_use_more_vram(use_more_vram) + self.model_use_more_vram(use_more_vram, force_patch_weights=force_patch_weights) real_model = self.model.model if is_intel_xpu() and not args.disable_ipex_optimize and 'ipex' in globals() and real_model is not None: