diff --git a/__init__.py b/__init__.py index 7237e92..1160962 100644 --- a/__init__.py +++ b/__init__.py @@ -1,3 +1,20 @@ +from video_extract_key_frames.nodes import ExtractKeyFrames, ExtractKeyFramesAndSplit + +# A dictionary that contains all nodes you want to export with their names +# NOTE: names should be globally unique +NODE_CLASS_MAPPINGS = { + "ExtractKeyFrames": ExtractKeyFrames, + "ExtractKeyFramesAndSplit": ExtractKeyFramesAndSplit, +} + +# A dictionary that contains the friendly/humanly readable titles for the nodes +NODE_DISPLAY_NAME_MAPPINGS = { + "ExtractKeyFrames": "Extract Key Frames", + "ExtractKeyFramesAndSplit": "Extract Key Frames & Split Video", +} + +WEB_DIRECTORY = "./web" + __all__ = [ "NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", @@ -7,7 +24,3 @@ __all__ = [ __author__ = """guyouyue""" __email__ = "guyuoyue@gmail.com" __version__ = "1.0.0" - -from src.video_extract_key_frames.nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS - -WEB_DIRECTORY = "./web" diff --git a/src/video_extract_key_frames/__init__.py b/video_extract_key_frames/__init__.py similarity index 100% rename from src/video_extract_key_frames/__init__.py rename to video_extract_key_frames/__init__.py diff --git a/src/video_extract_key_frames/nodes.py b/video_extract_key_frames/nodes.py similarity index 92% rename from src/video_extract_key_frames/nodes.py rename to video_extract_key_frames/nodes.py index b7888e6..410fc39 100644 --- a/src/video_extract_key_frames/nodes.py +++ b/video_extract_key_frames/nodes.py @@ -2,7 +2,7 @@ # 主要是各个节点的定义和业务逻辑 import folder_paths -from src.video_extract_key_frames.service import ( +from video_extract_key_frames.service import ( extract_keyframes, split_and_save_video_segments ) @@ -15,7 +15,7 @@ class ExtractKeyFrames: """ @classmethod - def INPUT_TYPES(s): + def INPUT_TYPES(cls): """ 定义节点所需输入参数的信息。 @@ -40,8 +40,8 @@ class ExtractKeyFrames: RETURN_TYPES = ("IMAGE", "STRING", "INT") RETURN_NAMES = ("KEYFRAMES", "indexes_string", "indexes_int") + CATEGORY = "ExtractKeyFrames(关键帧处理)" FUNCTION = "execute" - CATEGORY = "ExtractKeyFrames" def execute(self, image, threshold, merge_inter_frames, max_frames, similarity_method): """ @@ -172,15 +172,3 @@ class ExtractKeyFramesAndSplit: return (keyframe_images, indexes_string, keyframe_indices, segment_files_str) -# A dictionary that contains all nodes you want to export with their names -# NOTE: names should be globally unique -NODE_CLASS_MAPPINGS = { - "ExtractKeyFrames": ExtractKeyFrames, - "ExtractKeyFramesAndSplit": ExtractKeyFramesAndSplit, -} - -# A dictionary that contains the friendly/humanly readable titles for the nodes -NODE_DISPLAY_NAME_MAPPINGS = { - "ExtractKeyFrames": "Extract Key Frames", - "ExtractKeyFramesAndSplit": "Extract Key Frames & Split Video", -} diff --git a/src/video_extract_key_frames/service.py b/video_extract_key_frames/service.py similarity index 100% rename from src/video_extract_key_frames/service.py rename to video_extract_key_frames/service.py