diff --git a/__init__.py b/__init__.py index 9794310..65affdf 100644 --- a/__init__.py +++ b/__init__.py @@ -36,6 +36,16 @@ class SimpleStringRepository(io.ComfyNode): ], ) + @classmethod + def fingerprint_inputs(cls, **kwargs): + # Force re-execution when any random selector is set to -1 (auto-random) + for i in range(1, 6): + r = kwargs.get(f"random{i}", -1) + t = kwargs.get(f"target{i}", 0) + if t and r == -1: + return float("nan") # always re-run + return None # normal caching + @classmethod def execute(cls, string, delimiter, target1, strength1, random1, target2, strength2, random2, target3, strength3, random3, @@ -121,6 +131,16 @@ class SimpleStringRepositoryCompact(io.ComfyNode): ], ) + @classmethod + def fingerprint_inputs(cls, **kwargs): + # Force re-execution when any random selector is set to -1 (auto-random) + for i in range(1, 6): + r = kwargs.get(f"random{i}", -1) + t = kwargs.get(f"target{i}", 0) + if t and r == -1: + return float("nan") # always re-run + return None # normal caching + @classmethod def execute(cls, string, delimiter, target1, target2, target3, target4, target5): raw = [target1, target2, target3, target4, target5]