From e9f7cda706707590145aa4ed6a232ad7116d5bb3 Mon Sep 17 00:00:00 2001 From: silveroxides Date: Thu, 15 Jan 2026 02:51:17 +0100 Subject: [PATCH] fix: Free cpu_base after storing to avoid duplicate RAM usage --- nodes/lora_resize.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nodes/lora_resize.py b/nodes/lora_resize.py index b15c3ea..a0c7646 100644 --- a/nodes/lora_resize.py +++ b/nodes/lora_resize.py @@ -1790,12 +1790,15 @@ def merge_loras_to_model( else: # No LoRA contribution, copy as-is output_sd[base_key] = cpu_base.to(save_dtype).contiguous() + del cpu_base stats["copied"] += 1 else: # Non-weight tensor (bias, norm, etc.), copy as-is output_sd[base_key] = cpu_base.to(save_dtype).contiguous() + del cpu_base stats["copied"] += 1 + pbar.update(1) if verbose: