Compare commits

...

4 Commits

Author SHA1 Message Date
rewolf
9da28ea633
Merge ad1102fc1d into 98bdca4cb2 2025-04-10 16:28:35 -04:00
Chenlei Hu
98bdca4cb2
Deprecate InputTypeOptions.defaultInput (#7551)
* Deprecate InputTypeOptions.defaultInput

* nit

* nit
2025-04-10 06:57:06 -04:00
comfyanonymous
a26da20a76 Fix custom nodes not importing when path contains a dot. 2025-04-10 03:37:52 -04:00
rewolf
ad1102fc1d Modify LoadImage node to also traverse subdirectories of the input directory
Previously the LoadImage node only displayed direct file contents.

This change traverses the full directory tree under the `input_dir` using `os.walk`, including symlinks.
2025-03-12 16:03:25 +09:00
2 changed files with 9 additions and 4 deletions

View File

@ -102,9 +102,13 @@ class InputTypeOptions(TypedDict):
default: bool | str | float | int | list | tuple default: bool | str | float | int | list | tuple
"""The default value of the widget""" """The default value of the widget"""
defaultInput: bool defaultInput: bool
"""Defaults to an input slot rather than a widget""" """@deprecated in v1.16 frontend. v1.16 frontend allows input socket and widget to co-exist.
- defaultInput on required inputs should be dropped.
- defaultInput on optional inputs should be replaced with forceInput.
Ref: https://github.com/Comfy-Org/ComfyUI_frontend/pull/3364
"""
forceInput: bool forceInput: bool
"""`defaultInput` and also don't allow converting to a widget""" """Forces the input to be an input slot rather than a widget even a widget is available for the input type."""
lazy: bool lazy: bool
"""Declares that this input uses lazy evaluation""" """Declares that this input uses lazy evaluation"""
rawLink: bool rawLink: bool

View File

@ -1653,7 +1653,8 @@ 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))] strip_inputdir = lambda path: path[len(input_dir)+1:]
files = [strip_inputdir(os.path.join(dir,f)) for (dir, subdirs, files) in os.walk(input_dir, followlinks=True) for f in files]
return {"required": return {"required":
{"image": (sorted(files), {"image_upload": True})}, {"image": (sorted(files), {"image_upload": True})},
} }
@ -2136,7 +2137,7 @@ def load_custom_node(module_path: str, ignore=set(), module_parent="custom_nodes
module_name = sp[0] module_name = sp[0]
sys_module_name = module_name sys_module_name = module_name
elif os.path.isdir(module_path): elif os.path.isdir(module_path):
sys_module_name = module_path sys_module_name = module_path.replace(".", "_x_")
try: try:
logging.debug("Trying to load custom node {}".format(module_path)) logging.debug("Trying to load custom node {}".format(module_path))