From 3711b4d01f7f79d0fd50019c04d157f66bd16953 Mon Sep 17 00:00:00 2001 From: liminfei-amd <91481003+liminfei-amd@users.noreply.github.com> Date: Mon, 29 Jun 2026 03:08:00 +0000 Subject: [PATCH] free_memory: drop explanatory comment per review Signed-off-by: liminfei-amd <91481003+liminfei-amd@users.noreply.github.com> --- comfy/model_management.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index c33388199..570084f86 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -808,10 +808,6 @@ def free_memory(memory_required, device, keep_loaded=[], for_dynamic=False, pins can_unload = [] unloaded_models = [] - # Iterate a snapshot: free_memory can re-enter itself on this thread when a - # weakref finalizer (cleanup_models) fires during GC mid-loop and pops from - # current_loaded_models. Carry the LoadedModel object (not a stale absolute - # index) and remove unloaded entries by identity so a concurrent pop is tolerated. for shift_model in list(current_loaded_models): if device is None or shift_model.device == device: if shift_model not in keep_loaded and not shift_model.is_dead():