Skip to content

Commit

Permalink
Fix the input validation of the Prompt Reader node #37
Browse files Browse the repository at this point in the history
  • Loading branch information
receyuki committed Jan 2, 2024
1 parent a7fd3f1 commit 202b1fd
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,14 @@ def search_model(model: str):

@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):
Expand Down

0 comments on commit 202b1fd

Please sign in to comment.