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: