From ed0a74e40873388bb4d30b0e63ac421d159172ac Mon Sep 17 00:00:00 2001 From: Igal Ogonov Date: Wed, 21 Oct 2026 14:45:22 +0300 Subject: [PATCH] Update __init__.py Prevented comfy from caching results on dynamic prompts (only generate new random selections when the inputs change) --- __init__.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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]