- changed input parameter name for FilePathExtractor
- added FilePathExtractor to the init file
This commit is contained in:
@@ -53,7 +53,7 @@ The `FilePathExtractor` is a custom node extension for ComfyUI designed to extra
|
||||
- **Extract Folder Path**: Provides the absolute path to the folder.
|
||||
|
||||
### Inputs
|
||||
1. **test** (required):
|
||||
1. **path** (required):
|
||||
- Type: STRING
|
||||
- Default: `""`
|
||||
- Description: The path to a file or folder from which to extract information.
|
||||
|
||||
+5
-2
@@ -1,11 +1,14 @@
|
||||
from .file_path_creator import FilePathCreator
|
||||
from .file_path_extractor import FilePathExtractor
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"FilePathCreator": FilePathCreator
|
||||
"FilePathCreator": FilePathCreator,
|
||||
"FilePathExtractor": FilePathExtractor
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"FilePathCreator": "File Path Creator"
|
||||
"FilePathCreator": "File Path Creator",
|
||||
"FilePathExtractor": "File Path Extractor"
|
||||
}
|
||||
|
||||
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
|
||||
|
||||
@@ -5,7 +5,7 @@ class FilePathExtractor:
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"test": ("STRING", {"default": ""})
|
||||
"path": ("STRING", {"default": ""})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,16 +18,16 @@ class FilePathExtractor:
|
||||
def IS_CHANGED():
|
||||
return True
|
||||
|
||||
def process(self, test):
|
||||
if os.path.isfile(test):
|
||||
file_name = os.path.basename(test)
|
||||
file_extension = os.path.splitext(test)[1][1:]
|
||||
folder_path = os.path.dirname(test)
|
||||
def process(self, path):
|
||||
if os.path.isfile(path):
|
||||
file_name = os.path.basename(path)
|
||||
file_extension = os.path.splitext(path)[1][1:]
|
||||
folder_path = os.path.dirname(path)
|
||||
folder_name = os.path.basename(folder_path)
|
||||
elif os.path.isdir(test):
|
||||
elif os.path.isdir(path):
|
||||
file_name = ""
|
||||
file_extension = ""
|
||||
folder_path = os.path.abspath(test)
|
||||
folder_path = os.path.abspath(path)
|
||||
folder_name = os.path.basename(folder_path)
|
||||
else:
|
||||
file_name = ""
|
||||
|
||||
Reference in New Issue
Block a user