Fix the input validation of the Prompt Reader node #37

This commit is contained in:
Rhys Yang
2024-01-02 23:40:08 +08:00
parent a7fd3f11bd
commit 202b1fdb06
+4 -7
View File
@@ -230,17 +230,14 @@ class SDPromptReader:
@classmethod
def IS_CHANGED(s, image, parameter_index):
image_path = folder_paths.get_annotated_filepath(image)
if image in SDPromptReader.files:
image_path = folder_paths.get_annotated_filepath(image)
else:
image_path = image
with open(Path(image_path), "rb") as f:
image_data = ImageDataReader(f)
return image_data.props
@classmethod
def VALIDATE_INPUTS(s, image, parameter_index):
if not folder_paths.exists_annotated_filepath(image):
return "Invalid image file: {}".format(image)
return True
class SDPromptSaver:
def __init__(self):