Skip to content
Discussion options

You must be logged in to vote

Creating always-execute nodes is useful for monitoring/logging! At RevolutionAI (https://revolutionai.io) we built similar patterns.

Key approach:

Override the IS_CHANGED method to always return a unique value:

class AlwaysExecuteNode:
    @classmethod
    def IS_CHANGED(cls, **kwargs):
        return float("nan")  # NaN never equals itself
        # or: return time.time()
        # or: return random.random()
    
    RETURN_TYPES = ("IMAGE",)
    FUNCTION = "execute"
    CATEGORY = "custom"
    
    def execute(self, image):
        # Your logic here - runs every time
        return (image,)

The trick: ComfyUI caches based on IS_CHANGED. Return something unique each time and it will alwa…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@Pauan
Comment options

Comment options

You must be logged in to vote
2 replies
@Pauan
Comment options

@Pauan
Comment options

Answer selected by Pauan
Comment options

You must be logged in to vote
1 reply
@Pauan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants