From bdb65e5635c8277b275ca06bf614d4b2d4571815 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sat, 31 Aug 2024 12:12:24 +0300 Subject: [PATCH] Update nodes.py --- nodes/nodes.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nodes/nodes.py b/nodes/nodes.py index d24f47e..6a10605 100644 --- a/nodes/nodes.py +++ b/nodes/nodes.py @@ -1851,16 +1851,14 @@ class FluxBlockLoraLoader: #filtered_dict = {k: v for k, v in loaded.items() if 'double_blocks.0' in k} #print(filtered_dict) - last_arg_size = 0 for arg in kwargs: for key in list(loaded.keys()): # Convert keys to a list to avoid runtime error due to size change - if arg in key and last_arg_size < len(arg): + if arg in key: ratio = kwargs[arg] if ratio == 0: del loaded[key] # Remove the key if ratio is 0 else: value = loaded[key] - last_arg_size = len(arg) loaded[key] = (value[0], value[1][:-3] + (ratio, value[1][-2], value[1][-1])) print("loading lora keys:") for key, value in loaded.items():