diff --git a/__init__.py b/__init__.py index 5099af5..3823dcd 100644 --- a/__init__.py +++ b/__init__.py @@ -31,6 +31,10 @@ try: NODE_CLASS_MAPPINGS as PROMPT_TOOLS_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS as PROMPT_TOOLS_DISPLAY_MAPPINGS ) + from categories.video_tools import ( + NODE_CLASS_MAPPINGS as VIDEO_CLASS_MAPPINGS, + NODE_DISPLAY_NAME_MAPPINGS as VIDEO_DISPLAY_MAPPINGS + ) except ImportError: # Fallback for ComfyUI environments import importlib.util @@ -75,9 +79,13 @@ except ImportError: PROMPT_TOOLS_CLASS_MAPPINGS = prompt_tools.NODE_CLASS_MAPPINGS PROMPT_TOOLS_DISPLAY_MAPPINGS = prompt_tools.NODE_DISPLAY_NAME_MAPPINGS - # Video tools module doesn't exist yet - VIDEO_CLASS_MAPPINGS = {} - VIDEO_DISPLAY_MAPPINGS = {} + # Import video tools + spec = importlib.util.spec_from_file_location("video_tools", os.path.join(current_dir, "categories", "video_tools.py")) + video_tools = importlib.util.module_from_spec(spec) + spec.loader.exec_module(video_tools) + + VIDEO_CLASS_MAPPINGS = video_tools.NODE_CLASS_MAPPINGS + VIDEO_DISPLAY_MAPPINGS = video_tools.NODE_DISPLAY_NAME_MAPPINGS # Combine all category mappings @@ -104,9 +112,9 @@ NODE_DISPLAY_NAME_MAPPINGS.update(POST_PROCESS_DISPLAY_MAPPINGS) NODE_CLASS_MAPPINGS.update(PROMPT_TOOLS_CLASS_MAPPINGS) NODE_DISPLAY_NAME_MAPPINGS.update(PROMPT_TOOLS_DISPLAY_MAPPINGS) -# Video tools module doesn't exist yet (commented out for future use) -# NODE_CLASS_MAPPINGS.update(VIDEO_CLASS_MAPPINGS) -# NODE_DISPLAY_NAME_MAPPINGS.update(VIDEO_DISPLAY_MAPPINGS) +# Add video tools +NODE_CLASS_MAPPINGS.update(VIDEO_CLASS_MAPPINGS) +NODE_DISPLAY_NAME_MAPPINGS.update(VIDEO_DISPLAY_MAPPINGS) # API endpoints for web extensions diff --git a/categories/__init__.py b/categories/__init__.py index db63099..a3672f7 100644 --- a/categories/__init__.py +++ b/categories/__init__.py @@ -6,6 +6,7 @@ from .latent_tools import * from .math_tools import * from .file_tools import * from .post_process import * +from .video_tools import * # Import other category modules as they are added # from .image_tools import * diff --git a/shared/constants.py b/shared/constants.py index 6679839..9d5e703 100644 --- a/shared/constants.py +++ b/shared/constants.py @@ -71,6 +71,7 @@ MATH_CATEGORY = "math" FILE_CATEGORY = "file" POST_PROCESS_CATEGORY = "post_process" PROMPT_TOOLS_CATEGORY = "prompt_tools" +VIDEO_CATEGORY = "video" # Math node constants DEFAULT_MULTIPLIER_VALUE = 32