From 118e3afc206b3416349ee9c1d72e537410f4e9ec Mon Sep 17 00:00:00 2001 From: HalfikChan Date: Sun, 22 Mar 2026 04:21:59 +0500 Subject: [PATCH] Update nodes.py --- nodes.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index 04c0d83..e81cc4f 100644 --- a/nodes.py +++ b/nodes.py @@ -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: