Comfy-Org / Comfy-Org/ComfyUI

node ignores check lazy status when checking if things need processing

Open
#11,744 3 comments 0 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

If a node up the line changes, it shouldn't affect down stream caching

### Actual Behavior

A node at the beginning changes even though it's not used, it causes regeneration

### Steps to Reproduce

chain of nodes:
Node: int auto-increment
Node: Custom node (more on this below)
Node: Clip encode
Node: KSampler
Node: output

**Custom node:**

Node Input: int, it's attached to an int that auto-increments.
Node Output: text.
internal boolean switch to determine if the input is necessary.
internal multiline text sent to output

Inside the node py code it has the methods:
IS_CHANGED()
check_lazy_status()

IS_CHANGED is based on the internal text, and the int input if the boolean is true.
check_lazy_status() returns the int input only if the boolean is true, otherwise it returns empty array.

**On run:**
Now, I set boolean to false.
I run the workflow with all seeds set to fixed. The int input is still auto-increment.

**First run:**
text output sent to clip, gets to ksampler, outputs.

**Second run:**
Expected: int auto-increments. nothing else happens, because everything is cached and nothing changed, it shouldn't re-process anything. Since the node doesn't depend on the input, anything up the line related to that input shouldn't matter or affect things. The check_lazy_status lets it know that input isn't a dependency.

Actual: int auto-increments. Even though that input isn't returned, and IS_CHANGED hasn't changed, the clip node re-runs, reencoding the same thing it did previously and down the rest of the chain it continues recalculating every node.

If I disconnect the auto-increment node, then the expected thing happens, but the status check should cause it to be disregarded anyway.

### Debug Logs

```powershell
none
```

### Other

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.