diff --git a/CHANGELOG.md b/CHANGELOG.md index 28dbc68..cdfe525 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # nightly +- Fix `SimpleLoadImageWithMetadata` - Add `Simple Remove Think` node # v1.0.6 - Add `Simple Auto Bypass` node diff --git a/js/SimpleLoadImageWithMetadata.js b/js/SimpleLoadImageWithMetadata.js index 5abf765..a11fd46 100644 --- a/js/SimpleLoadImageWithMetadata.js +++ b/js/SimpleLoadImageWithMetadata.js @@ -1,9 +1,16 @@ import { app } from "/scripts/app.js"; + app.registerExtension({ - name: "Simple Load Image With Metadata", - async beforeRegisterNodeDef(nodeType, nodeData, app) { - if (nodeData.name === "Simple Load Image With Metadata") { - nodeData.input.required.upload = ["IMAGEUPLOAD"]; - } - }, + name: "Simple Load Image With Metadata", + async beforeRegisterNodeDef(nodeType, nodeData, app) { + if (nodeData.name === "Simple Load Image With Metadata") { + nodeData.INPUT_TYPES = { + upload: { + type: "IMAGEUPLOAD", + required: true, + default: null + } + }; + } + }, }); \ No newline at end of file diff --git a/nodes/nodes.py b/nodes/nodes.py index 7705c56..3b3b2df 100644 --- a/nodes/nodes.py +++ b/nodes/nodes.py @@ -685,14 +685,9 @@ class SimpleImageSaver: ################################ -class SimpleLoadImageWithMetadataString: - @classmethod - def INPUT_TYPES(s): - input_dir = folder_paths.get_input_directory() - files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))] - return {"required": - {"image": (sorted(files), )}, - } +from nodes import LoadImage + +class SimpleLoadImageWithMetadataString(LoadImage): CATEGORY = "📚 SimpleButcher" RETURN_TYPES = ("IMAGE", "MASK", "STRING", "STRING", "STRING") RETURN_NAMES = ("image", "mask", "metadata_parameters (forge)", "metadata_workflow", "metadata_prompt") @@ -730,19 +725,6 @@ class SimpleLoadImageWithMetadataString: return (image, mask, forge, workflow_json, prompt_json) - @classmethod - def IS_CHANGED(s, image): - 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): - if not folder_paths.exists_annotated_filepath(image): - return "Invalid image file: {}".format(image) - return True class SimpleLoadImagesFromDir: