diff --git a/README.md b/README.md index 57016f0..16474d7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,17 @@ # ComfyUI Video Reverse + A tool to reverse the frames of a video using CompfyUI. + +# Install ComfyUI Video Reverse + +1. Navigate to your ComfyUI/custom_nodes folder. + +2. Run, + + git clone https://github.com/Sean-Bradley/ComfyUI-Image-Compare.git + +3. Restart ComfyUI + +You will find the new Video Reverse node in the Nodes menu item under SBCODE. + +Or you can double click the workspace and search for `video reverse`. diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..bd5fa2a --- /dev/null +++ b/__init__.py @@ -0,0 +1,26 @@ +class VideoReverseNode: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "frames": ("IMAGE",), + } + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "reverse" + CATEGORY = "SBCODE" + + def reverse(self, frames): + if frames is None or len(frames) == 0: + return {} + + frames.reverse() + + print("The video frames have now been reversed.") + + return (frames,) + + +NODE_CLASS_MAPPINGS = {"VideoReverseNode": VideoReverseNode} +NODE_DISPLAY_NAME_MAPPINGS = {"VideoReverseNode": "Video Reverse"}