Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add node video previews #2635

Merged
merged 13 commits into from
Feb 22, 2025
Merged

Add node video previews #2635

merged 13 commits into from
Feb 22, 2025

Conversation

christian-byrne
Copy link
Collaborator

@christian-byrne christian-byrne commented Feb 19, 2025

Adds support for nodes with video previews.

load-video-node.mp4

To specify that a node should support video upload (including drag-and-drop, paste, file upload), use video_upload in the input options dict:

class LoadVideo:
    @classmethod
    def INPUT_TYPES(s):
        input_dir = folder_paths.get_input_directory()
        return {"required":
                    {"video": (folder_paths.filter_files_content_types(os.listdir(input_dir), ["video"]), 
                               {"video_upload": True})}, # use `video_upload` flag
                }

To specify that a node should output video previews:

        results = [{
            "filename": "video.webm",
            "subfolder": subfolder,
            "type": "output"
        }]
        return { "ui": { "images": results, "animated": (True,) } }

Note: image inputs (and image nodes) are now identified by checking for a combo input with the image_upload property, rather than checking for a required input named 'image.'

For followup PRs:

  • Support parsing WEBM metadata for workflow load
  • When pasting video onto empty canvas, create and populate Load WEBM node, as with Load Image. Must wait until the node is added to core.

┆Issue is synchronized with this Notion page by Unito

Copy link
Member

@huchenlei huchenlei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christian-byrne
Copy link
Collaborator Author

christian-byrne commented Feb 19, 2025

Still need to finish output previews migration and implement metadata parse / workflow load.

Edit: metadata parse will be implemented in followup PR.

Using with WEBM nodes:

webm.mp4

@christian-byrne christian-byrne marked this pull request as ready for review February 22, 2025 17:03
@christian-byrne christian-byrne requested a review from a team as a code owner February 22, 2025 17:03
@huchenlei huchenlei merged commit f94831d into main Feb 22, 2025
10 checks passed
@huchenlei huchenlei deleted the video-preview branch February 22, 2025 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants