fix(prompt): invalidate dynamic wildcard cache without seed (#895)

This commit is contained in:
Will Miao
2026-04-15 20:43:21 +08:00
parent b910388d54
commit 2640258902
5 changed files with 65 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
from __future__ import annotations
from ..services.wildcard_service import get_wildcard_service
from ..services.wildcard_service import contains_dynamic_syntax, get_wildcard_service
class TextLM:
@@ -41,5 +41,11 @@ class TextLM:
OUTPUT_TOOLTIPS = ("The text output.",)
FUNCTION = "process"
@classmethod
def IS_CHANGED(cls, text: str, seed: int | None = None):
if contains_dynamic_syntax(text) and seed is None:
return float("NaN")
return False
def process(self, text: str, seed: int | None = None):
return (get_wildcard_service().expand_text(text, seed=seed),)