Update nodes.py
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user