Open wencxxxxxx opened 2 months ago
I just had the same issue and had a quick look at DPAbstractSamplerNode
to fix this issue in the Random Prompts
node:
@classmethod
def IS_CHANGED(cls, text: str, seed: int, autorefresh: str):
if autorefresh == "Yes":
# Force re-evaluation of the node
return float("NaN")
else:
# Re-evaluate only in case the seed and/or text has changed
m = sha256()
m.update(str(seed).encode())
m.update("".encode() if text is None else text.encode())
# print(f"Hash: {m.hexdigest()}, Seed: {str(seed)}, Text: {text}") # debug
return m.hexdigest()
The original code always returned float("NaN")
meaning the node will always be treated as changed, according to this.
Is the author still maintaining this node?
Please optimize this bug, can you
@cbaoth I tried your fix by editing the sampler.py
to this :
@classmethod
def IS_CHANGED(cls, text: str, seed: int, autorefresh: str):
if autorefresh == "Yes":
# Force re-evaluation of the node
return float("NaN")
else:
# Re-evaluate only in case the seed and/or text has changed
m = sha256()
m.update(str(seed).encode())
m.update("".encode() if text is None else text.encode())
# print(f"Hash: {m.hexdigest()}, Seed: {str(seed)}, Text: {text}") # debug
return m.hexdigest()
RETURN_TYPES = ("STRING",)
FUNCTION = "get_prompt"
CATEGORY = "Dynamic Prompts"
But it still insists on sampling over and over unfortunately
Fixed dynamic prompt word seed, fixed sampler seed, still sampling.