Change validate_inputs' output typehint to 'bool | str' and update docstrings (#9786)

This commit is contained in:
Jedrzej Kosinski
2025-09-09 18:33:36 -07:00
committed by GitHub
parent b288fb0db8
commit 206595f854

View File

@@ -1190,13 +1190,18 @@ class _ComfyNodeBaseInternal(_ComfyNodeInternal):
raise NotImplementedError raise NotImplementedError
@classmethod @classmethod
def validate_inputs(cls, **kwargs) -> bool: def validate_inputs(cls, **kwargs) -> bool | str:
"""Optionally, define this function to validate inputs; equivalent to V1's VALIDATE_INPUTS.""" """Optionally, define this function to validate inputs; equivalent to V1's VALIDATE_INPUTS.
If the function returns a string, it will be used as the validation error message for the node.
"""
raise NotImplementedError raise NotImplementedError
@classmethod @classmethod
def fingerprint_inputs(cls, **kwargs) -> Any: def fingerprint_inputs(cls, **kwargs) -> Any:
"""Optionally, define this function to fingerprint inputs; equivalent to V1's IS_CHANGED.""" """Optionally, define this function to fingerprint inputs; equivalent to V1's IS_CHANGED.
If this function returns the same value as last run, the node will not be executed."""
raise NotImplementedError raise NotImplementedError
@classmethod @classmethod