Compare commits

...
Author SHA1 Message Date
Chengwei Ouyang ced3e0de2f remove image 2025-03-12 15:11:54 +08:00
shanexi 0599875a79 fix: input image error in new comfyui version 2025-03-12 14:55:39 +08:00
Chengwei Ouyang 33899c19dc Merge pull request #10 from myshell-ai/fix_input_image
[Fix] Adapt to the new version comfyui
2025-03-10 23:28:05 +08:00
Chengwei Ouyang 06163a06d4 i[date 2025-03-10 23:21:36 +08:00
shanexi 087571346c Merge pull request #9 from myshell-ai/support-input-video
feat: support input audio
2025-02-13 17:44:28 +08:00
2 changed files with 13 additions and 12 deletions
+12 -11
View File
@@ -48,14 +48,13 @@ class ShellAgentPluginInputImage:
{"multiline": False, "default": "input_image", "forceInput": False},
),
"default_value": (
# "STRING", {"image_upload": True, "default": files[0] if len(files) else ""},
sorted(files), {"image_upload": True, "forceInput": False}
),
},
"optional": {
"description": (
"STRING",
{"multiline": True, "default": "", "forceInput": False},
{"multiline": False, "default": "", "forceInput": False},
),
}
}
@@ -79,20 +78,21 @@ class ShellAgentPluginInputImage:
return schema
@classmethod
def VALIDATE_INPUTS(s, input_name, default_value, description=""):
image = default_value
def VALIDATE_INPUTS(s, input_name, default_value, image=None, description=""):
# check default_value first
image_to_check = default_value if default_value else image
if image.startswith("http"):
if image_to_check.startswith("http"):
return True
if image == "":
if image_to_check == "":
return "Invalid image file: please check if the image is empty or invalid"
if os.path.isfile(image):
if os.path.isfile(image_to_check):
return True
if not folder_paths.exists_annotated_filepath(image):
return "Invalid image file: {}".format(image)
if not folder_paths.exists_annotated_filepath(image_to_check):
return "Invalid image file: {}".format(image_to_check)
return True
@@ -137,9 +137,10 @@ class ShellAgentPluginInputImage:
return (output_image, output_mask)
def run(self, input_name, default_value=None, display_name=None, description=None):
def run(self, input_name, default_value=None, image=None, display_name=None, description=None):
# use default_value if it exists, otherwise use image
image_path = default_value if default_value else image
input_dir = folder_paths.get_input_directory()
image_path = default_value
try:
if image_path.startswith('http'):
import requests
+1 -1
View File
@@ -171,7 +171,7 @@ app.registerExtension({
) {
nodeData.input.required.upload = [
"IMAGEUPLOAD",
{ widget: "default_value" },
{ widget: "default_value", imageInputName: "default_value", image_upload: true },
];
}
}