From c9db610c0b51a8d8a19a5611a7c8a0e2ee70bad2 Mon Sep 17 00:00:00 2001 From: guoliheng Date: Mon, 20 Oct 2025 09:56:33 +0800 Subject: [PATCH] =?UTF-8?q?v=200.0.2:=20feat(video):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=B8=A7=E6=8F=90=E5=8F=96=E4=B8=8E=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=88=86=E5=89=B2=E5=8A=9F=E8=83=BD-=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20ExtractKeyFrames=20=E8=8A=82=E7=82=B9=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E6=8F=90=E5=8F=96=E8=A7=86=E9=A2=91=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=B8=A7=20-=20=E6=96=B0=E5=A2=9E=20ExtractKeyFramesAndSplit?= =?UTF-8?q?=20=E8=8A=82=E7=82=B9=E7=94=A8=E4=BA=8E=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E6=8F=90=E5=8F=96=E5=85=B3=E9=94=AE=E5=B8=A7=E5=B9=B6=E5=88=86?= =?UTF-8?q?=E5=89=B2=E8=A7=86=E9=A2=91=20-=20=E6=9B=B4=E6=96=B0=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=AF=BC=E5=85=A5=E8=B7=AF=E5=BE=84=E4=BB=A5=E9=80=82?= =?UTF-8?q?=E9=85=8D=E9=87=8D=E6=9E=84=E5=90=8E=E7=9A=84=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E7=BB=93=E6=9E=84-=20=E4=BF=AE=E6=94=B9=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E5=90=8D=E7=A7=B0=E4=B8=BA=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=20-=20=E7=A7=BB=E9=99=A4=E6=97=A7=E7=89=88?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E6=98=A0=E5=B0=84=E9=85=8D=E7=BD=AE=E5=B9=B6?= =?UTF-8?q?=E9=9B=86=E4=B8=AD=E7=AE=A1=E7=90=86=E5=AF=BC=E5=87=BA=E8=8A=82?= =?UTF-8?q?=E7=82=B9=20-=E4=BC=98=E5=8C=96=E8=BE=93=E5=85=A5=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=AE=9A=E4=B9=89=E6=96=B9=E6=B3=95=E7=AD=BE=E5=90=8D?= =?UTF-8?q?=20-=20=E4=BF=9D=E7=95=99=20WEB=5FDIRECTORY=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=94=AF=E6=8C=81=E5=89=8D=E7=AB=AF=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __init__.py | 21 +++++++++++++++---- .../__init__.py | 0 .../nodes.py | 18 +++------------- .../service.py | 0 4 files changed, 20 insertions(+), 19 deletions(-) rename {src/video_extract_key_frames => video_extract_key_frames}/__init__.py (100%) rename {src/video_extract_key_frames => video_extract_key_frames}/nodes.py (92%) rename {src/video_extract_key_frames => video_extract_key_frames}/service.py (100%) 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