IS_CHANGED->fingerprint_inputs , VALIDATE_INPUTS->validate_inputs

This commit is contained in:
bigcat88 2025-07-09 14:02:28 +03:00
parent fefb24cc33
commit 8f0621ca7e
No known key found for this signature in database
GPG Key ID: 1F0BF0EC3CF22721
2 changed files with 6 additions and 7 deletions

View File

@ -165,7 +165,7 @@ class LoadImage(io.ComfyNodeV3):
return io.NodeOutput(output_image, output_mask)
@classmethod
def IS_CHANGED(s, image):
def fingerprint_inputs(s, image):
image_path = folder_paths.get_annotated_filepath(image)
m = hashlib.sha256()
with open(image_path, 'rb') as f:
@ -173,7 +173,7 @@ class LoadImage(io.ComfyNodeV3):
return m.digest().hex()
@classmethod
def VALIDATE_INPUTS(s, image):
def validate_inputs(s, image):
if not folder_paths.exists_annotated_filepath(image):
return "Invalid image file: {}".format(image)
return True
@ -260,7 +260,7 @@ class LoadImageOutput(io.ComfyNodeV3):
return io.NodeOutput(output_image, output_mask)
@classmethod
def IS_CHANGED(s, image):
def fingerprint_inputs(s, image):
image_path = folder_paths.get_annotated_filepath(image)
m = hashlib.sha256()
with open(image_path, 'rb') as f:
@ -268,7 +268,7 @@ class LoadImageOutput(io.ComfyNodeV3):
return m.digest().hex()
@classmethod
def VALIDATE_INPUTS(s, image):
def validate_inputs(s, image):
if not folder_paths.exists_annotated_filepath(image):
return "Invalid image file: {}".format(image)
return True

View File

@ -100,16 +100,15 @@ class WebcamCapture(io.ComfyNodeV3):
return io.NodeOutput(output_image, output_mask)
@classmethod
def IS_CHANGED(s, image, width, height, capture_on_queue):
def fingerprint_inputs(s, image, width, height, capture_on_queue):
image_path = folder_paths.get_annotated_filepath(image)
m = hashlib.sha256()
with open(image_path, 'rb') as f:
m.update(f.read())
return m.digest().hex()
@classmethod
def VALIDATE_INPUTS(s, image):
def validate_inputs(s, image):
if not folder_paths.exists_annotated_filepath(image):
return "Invalid image file: {}".format(image)
return True