Fixed dynamic inputs again.

This commit is contained in:
moonwhaler
2025-06-20 15:31:18 +02:00
parent 2f1543e081
commit 790b2fdeea
2 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -16,7 +16,8 @@ class DynamicLoraStack:
def stack_loras(self, **kwargs):
loras = []
# Sort kwargs by key to maintain the order of inputs
for key, value in sorted(kwargs.items()):
sorted_items = sorted(kwargs.items(), key=lambda item: int(item[0].split('_')[1]))
for key, value in sorted_items:
if key.startswith("lora_") and value is not None:
loras.append(value)
+4 -2
View File
@@ -45,8 +45,10 @@ class DynamicStringConcat:
# Sammle alle Input-Strings
inputs = []
# Durchlaufe alle bereitgestellten Keyword-Argumente
for key, value in sorted(kwargs.items()):
# Sortiere die Inputs numerisch, um die korrekte Reihenfolge sicherzustellen
sorted_items = sorted(kwargs.items(), key=lambda item: int(item[0].split('_')[1]) if item[0].startswith("input_") else -1)
for key, value in sorted_items:
if key.startswith("input_") and value is not None:
if isinstance(value, (list, tuple)):
# Falls es ein Array ist, nimm das erste Element