mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-03 18:20:26 +08:00
Merge 382c20809b into 09725967cf
This commit is contained in:
commit
3d423fed35
13
nodes.py
13
nodes.py
@ -1695,19 +1695,24 @@ class PreviewImage(SaveImage):
|
|||||||
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
|
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class LoadImage:
|
class LoadImage:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
input_dir = folder_paths.get_input_directory()
|
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))]
|
image_paths = []
|
||||||
files = folder_paths.filter_files_content_types(files, ["image"])
|
for root, _, files in os.walk(input_dir, followlinks=True):
|
||||||
|
image_files = folder_paths.filter_files_content_types(files, ["image"])
|
||||||
|
for image_file in image_files:
|
||||||
|
path_relative = os.path.relpath(os.path.join(root, image_file), input_dir)
|
||||||
|
path_relative = path_relative.replace('\\', '/')
|
||||||
|
image_paths.append(path_relative)
|
||||||
return {"required":
|
return {"required":
|
||||||
{"image": (sorted(files), {"image_upload": True})},
|
{"image": (sorted(list(set(image_paths))), {"image_upload": True})},
|
||||||
}
|
}
|
||||||
|
|
||||||
CATEGORY = "image"
|
CATEGORY = "image"
|
||||||
SEARCH_ALIASES = ["load image", "open image", "import image", "image input", "upload image", "read image", "image loader"]
|
SEARCH_ALIASES = ["load image", "open image", "import image", "image input", "upload image", "read image", "image loader"]
|
||||||
|
|
||||||
RETURN_TYPES = ("IMAGE", "MASK")
|
RETURN_TYPES = ("IMAGE", "MASK")
|
||||||
FUNCTION = "load_image"
|
FUNCTION = "load_image"
|
||||||
def load_image(self, image):
|
def load_image(self, image):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user