was-node-suite-comfyui icon indicating copy to clipboard operation
was-node-suite-comfyui copied to clipboard

Random Number node always triggers subsequent nodes

Open Pyrosopher opened this issue 2 years ago • 10 comments

When set to fixed, the Random Number node still triggers next nodes even though there hasn't been a change.

Pyrosopher avatar Aug 16 '23 18:08 Pyrosopher

Yeah the IS_CHANGED method is really weird to work with. Instead of just True it is changed, or False it isn't, it expects a hash from some data.

WASasquatch avatar Aug 19 '23 17:08 WASasquatch

Experiencing this problem right now, it's retriggering a huge amount of downstream nodes. Any way to circumvent the problem?

everdrone avatar Jun 17 '24 17:06 everdrone

I'll look into it. I assume I made it always run to count, to get a new number, but failed to account for when it's fixed by, like, not having it always run. Oops.

On Mon, Jun 17, 2024, 10:56 AM everdrone @.***> wrote:

Experiencing this problem right now, it's retriggering a huge amount of downstream nodes. Any way to circumvent the problem?

— Reply to this email directly, view it on GitHub https://github.com/WASasquatch/was-node-suite-comfyui/issues/166#issuecomment-2173999319, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIZEZITWPKWAQJE26B4IULZH4PLLAVCNFSM6AAAAABJOO7EW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZTHE4TSMZRHE . You are receiving this because you commented.Message ID: @.***>

WASasquatch avatar Jun 17 '24 19:06 WASasquatch

I'm also running into this issue. I'm trying to incorporate the Random Number node into a workflow that generates a random crop. I'm noticing it triggers a render even if I'm just moving a node around and nothing else has changed.

https://github.com/user-attachments/assets/c124cccb-ec9d-466a-94dc-c1518bf8558e

brbbbq avatar Aug 09 '24 15:08 brbbbq

In WAS_Node_Suite.py, under the WAS_Random_Number class, I commented out these lines, which seems to fix my situation for the time being:

#    @classmethod
#    def IS_CHANGED(cls, seed, **kwargs):
#        m = hashlib.sha256()
#        m.update(seed)
#        return m.digest().hex()

brbbbq avatar Aug 09 '24 16:08 brbbbq

Has there been a change to on change method? Hex for same seed should be the same, thus match cached value.

WASasquatch avatar Aug 09 '24 16:08 WASasquatch

Has there been a change to on change method? Hex for same seed should be the same, thus match cached value.

I have no idea. I tried testing the WAS Seed node to see if it might display similar behavior, but it works without issue. When I put it in fixed mode it doesn't render if there's no change with Auto Queue enabled.

Here's my version info:

ComfyUI: 2340[2dc84d](2024-07-06)
Manager: V2.46

brbbbq avatar Aug 09 '24 20:08 brbbbq

I'll have to look into it. The reason I have that in there is because I don't rely on front end mechanics, so headless server stuff can still function.

On Fri, Aug 9, 2024, 1:51 PM brbbbq @.***> wrote:

Has there been a change to on change method? Hex for same seed should be the same, thus match cached value.

I have no idea. I tried the WAS Seed node, and it works without issue. When I put it in fixed mode it doesn't render if there's no change.

Here's my version info: ComfyUI: 23402dc84d http://2024-07-06 Manager: V2.46

— Reply to this email directly, view it on GitHub https://github.com/WASasquatch/was-node-suite-comfyui/issues/166#issuecomment-2278739357, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIZEZLG7GEYSOBLKBS5SBTZQUTUJAVCNFSM6AAAAABJOO7EW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZYG4ZTSMZVG4 . You are receiving this because you commented.Message ID: @.***>

WASasquatch avatar Aug 09 '24 22:08 WASasquatch

I really don't know anything about the code. I will say that it's not that the server isn't refreshing after every change, such as moving nodes around. In the console window it says:

[rgthree] Using rgthree's optimized recursive execution.
Prompt executed in 0.02 seconds

It's that the Random Number node is causing the KSampler to render that's the issue. I don't know if that's helpful at all.

brbbbq avatar Aug 09 '24 22:08 brbbbq

Yeah I understand what's happening, but it shouldn't. The change function reduces the seed to a unique hex, basically like a seed itself. The same seed should always yield the same hexadecimal value and tell ConfyUI there has been no change. It could be the rgthree execution server change but not sure.

On Fri, Aug 9, 2024, 3:43 PM brbbbq @.***> wrote:

I really don't know anything about the code. I will say that it's not that the server isn't refreshing after every change, such as moving nodes around. In the console window it says:

[rgthree] Using rgthree's optimized recursive execution. Prompt executed in 0.02 seconds

It's that the Random Number nodes is triggering the KSampler to render that's the issue. I don't know if that's helpful at all.

— Reply to this email directly, view it on GitHub https://github.com/WASasquatch/was-node-suite-comfyui/issues/166#issuecomment-2278842086, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIZEZLOXRO2VGFLVYZS673ZQVA2RAVCNFSM6AAAAABJOO7EW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZYHA2DEMBYGY . You are receiving this because you commented.Message ID: @.***>

WASasquatch avatar Aug 10 '24 05:08 WASasquatch