Update nodes.py

This commit is contained in:
HalfikChan
2026-03-22 04:21:59 +05:00
parent c5f2fe8cdf
commit 118e3afc20
+19 -1
View File
@@ -176,7 +176,25 @@ class PromptCombiner:
@classmethod
def IS_CHANGED(cls, separator, prompt_selections="{}", **kwargs):
return prompt_selections + str(kwargs)
# Build a fingerprint that includes actual prompt content,
# so edits to prompt text invalidate the cache.
try:
selections = _json.loads(prompt_selections)
except _json.JSONDecodeError:
selections = {}
parts = [separator, prompt_selections]
for key in sorted(kwargs.keys()):
if not key.startswith("selection_"):
continue
category = kwargs[key]
prompt_name = _clean_name(selections.get(key, ""))
if category and prompt_name:
prompt = db.get_prompt_by_name(prompt_name, category)
if prompt:
parts.append(prompt["text"])
parts.append(str(prompt.get("loras", [])))
return "|".join(parts)
class ApplyLoraStack: