Commit Graph
49 Commits
Author SHA1 Message Date
Austin Mroz d51cb7c7a9 Fix preview on node-add, consistent naming
When a Load Video node is added, the default video selection is now
properly displayed with a preview.

Context menu options now consistently use preview instead of video as
the actions apply to animated images as well.
2023-10-28 15:24:59 -05:00
Austin Mroz 68b66e7e3e Add missing formatDate code
Disable code for non-existent VHS_SaveImageSequence
2023-10-28 15:13:13 -05:00
Austin Mroz 633351c64f Fix file uploads 2023-10-28 14:46:26 -05:00
Austin Mroz 4db66a807d Properly clear previews of nodes moved off screen.
With the preview element no longer named as inputEl, the pertinent code
that would hide the element when off screen no longer applied.

This is fixed and has the added benefit of preventing dangling
video elements even when a multiline widget has not yet injected it's
own fix.
2023-10-26 20:01:06 -05:00
Austin Mroz b8d629248e Add migratory code to prevent need for remove/add
While the new KV state storage should prevent the need for this in the
future and there's a degree of error checking, it would be particularly
poor optics for the system to break all existing workflows on release.

This adds a couple of migratory functions that carefully check and
manage the transitions for the two nodes that break.
2023-10-26 19:29:59 -05:00
Austin Mroz 3a6b9fb5c7 Fix node removal cleanup, hide unsupported preview
The onRemoved code for the preview widget wasn't actually firing, so the
callback has been moved to the node.onRemoved.

The file-input's created for nodes that support uploading were never
removed and have been corrected by the same method.

When a video is generated that can not be displayed in browser
(those using the h265 codec), the preview is now hidden

The 'video' field of Load Video (Upload) is now properly initialized
2023-10-26 18:20:48 -05:00
Austin Mroz f80d6a2dde Preview options at top, comfy error dialogs
Context menu options for video previews have been moved to the top of
the list.

When a node fails to load the nicer comfy error dialog is used.
Errors on file upload still use alert, but this is equivalent to the
native comfy code.

Video previews are muted.

The image preview element is hidden by default.
2023-10-25 15:24:08 -05:00
Austin Mroz 121da143c5 Merge branch 'main' into js_cleanup
Mostly trivial. Just a minor change to resolve the
selected video to a url in Load Video (Upload)
2023-10-24 17:09:10 -05:00
Austin Mroz 0b3b482d66 Add Open/Save Video, mark dirty on resize
Open and Save Video buttons have been added to the context menu.
This brings parity with the functionality of the Save Image node,
and restores functionality that was removed with passing through clicks
on the video preview element.

When a resize is done on a node, it is marked dirty.
This fixes a minor delay between preview content displaying
and the underlying node performing it's resize
2023-10-24 12:20:41 -05:00
Austin Mroz b609407849 Improved preview support
Implement animated image previews
add control options to context menu:
- Hide/Show
- Pause/Resume
- Sync
2023-10-23 23:19:07 -05:00
Austin Mroz 44674091e5 Reimplement video previews, kv state serialization
The reimplementation for video previews is functional and adds base
support for previews in load video (upload)

State serialization for nodes (what's used when a workflow is loaded or
the webpage is refreshed) now uses a map with widget names as keys for
all VHS nodes.
2023-10-23 00:04:19 -05:00
Jedrzej Kosinski 639b6ea247 Fixed git_preview.js to use 4 spaces instead of 2 in code 2023-10-21 12:24:48 -05:00
Jedrzej Kosinski e66a5b0a36 Add back code that got reverted erroneously, thank you git 2023-10-21 12:14:46 -05:00
Jedrzej Kosinski 6965182f5d Reversion (had merge conflict) 2023-10-21 11:46:40 -05:00
Jedrzej Kosinski 44cd01673c Revert "Merge pull request #21 from kijai/main"
This reverts commit b2c4b4a5ac, reversing
changes made to f032b046af.
2023-10-21 11:39:32 -05:00
Jedrzej Kosinski 91c8176a05 Revert "Fix video autoplay..."
This reverts commit 18f15ef6ca.
2023-10-21 11:39:27 -05:00
Jedrzej Kosinski dfc32c979a Revert "Update gif_preview.js"
This reverts commit f705532da5.
2023-10-21 11:39:24 -05:00
Jedrzej Kosinski 25d948b431 Revert "Merge pull request #28 from kijai/main"
This reverts commit a5c5556f8d, reversing
changes made to 72340a31d2.
2023-10-21 11:39:21 -05:00
Jedrzej Kosinski 23c66488d1 Revert "fixed ID referenced in videoupload.js for VHS_LoadVideo"
This reverts commit ec297dc512.
2023-10-21 11:39:11 -05:00
Jedrzej Kosinski 50c4866c12 Revert "Merge pull request #30 from kijai/main"
This reverts commit d38405807c, reversing
changes made to 11ad341025.
2023-10-21 11:38:45 -05:00
Jedrzej Kosinski 0c6af481eb Revert "Fixed dragging upload always putting file into subdirectory, rearranged (and temporarily removed) pil fallback"
This reverts commit 15f545efe2.
2023-10-21 11:38:25 -05:00
Jedrzej Kosinski 15f545efe2 Fixed dragging upload always putting file into subdirectory, rearranged (and temporarily removed) pil fallback 2023-10-20 23:26:37 -05:00
Austin Mroz c3ae8f2ec9 Work in progress rewrite of JS code
Includes code for uploads, customsize, dateformatting,
forcing timestamps, and hiding the useless GIF output of the combine
video node, but lacks the video preview code and testing.
2023-10-20 12:50:32 -05:00
Jedrzej Kosinski d38405807c Merge pull request #30 from kijai/main
Update gif_preview.js
2023-10-20 10:54:47 -05:00
kijai c61bcaf2a4 Update gif_preview.js
This prevented autoplay from working now...
2023-10-20 18:40:12 +03:00
Jedrzej Kosinski ec297dc512 fixed ID referenced in videoupload.js for VHS_LoadVideo 2023-10-20 09:31:07 -05:00
kijai f705532da5 Update gif_preview.js 2023-10-20 15:38:33 +03:00
kijai 18f15ef6ca Fix video autoplay...
Video element never calls the onload function, I didn't figure out why... so just moved it out of it to restore functionality.
2023-10-20 15:30:04 +03:00
kijai fda9ffd0df Merge remote-tracking branch 'upstream/main' 2023-10-20 12:50:44 +03:00
JaredTherriault 9306e62e0a Restore VHS_LoadVideoPath and VHS_LoadVideoUpload, update to parity with VHS_UploadVideo
-Restore original name of 'VHS_LoadVideo' to 'VHS_LoadVideoPath'
-Restore LoadVideoUpload and bring its features up to parity with LoadVideoPath and UploadVideo
-Rename 'input' and 'effective' variables to 'original' and 'actual'
-Add guard clause for undefined video widget value
2023-10-17 19:49:01 -07:00
JaredTherriault ba7bc35390 UploadVideo, gif preview autoplay fix, VideoInfo out from LoadVideo, support webp, apng, mjpeg
-Add PIL fallback to LoadVideo to support video types not supported by opencv2, such as webp, apng, and mjpeg. Changing frame rate is not supported in this mode. The output log will inform you of this when the fallback is used.
-Removed VHS_LoadVideoUpload node
-Renamed VHS_LoadVideoPath to just VHS_LoadVideo
-Added a video_info output to LoadVideo which includes more information, such as the frame count, fps, duration and frame time for the input video and the output frames
-Added a new node UploadVideo which includes the functionality of LoadVideoUpload insofar as copying a video to the input folder but also allows the user to upload to temp instead for testing so as not to clutter the input folder. Uploaded videos now go to a subfolder, 'VHS_upload'.
-Added gif preview to UploadVideo so uploaded videos can be viewed on the node when selected.
-Fixed autoplay for gif preview on VideoCombine, still not working for videos on UploadVideo node.
-Added drag and drop for videos on UploadVideo node.
-Changed 'force_frame_rate' to 'desired_frame_rate' because it cannot be forced in PIL fallback, this is an effort to communicate this to the user
2023-10-16 21:31:32 -07:00
kijai 05cd93de4e Update gif_preview.js
make it select by id instead to not affect possible other elements
2023-10-12 19:18:10 +03:00
kijai a8470de02e Sync gifs too
gif elemenets weren't being reset with the sync button, made it reload all gifs for same effect
2023-10-12 19:02:31 +03:00
Jedrzej Kosinski 8f10981d32 Merge pull request #15 from kijai/main
Add preview video playback syncing
2023-10-12 05:41:11 -05:00
Jedrzej Kosinski dcb851d581 created Path versions of Load Video and Load Images nodes 2023-10-10 04:40:17 -05:00
kijai 00f0981763 Add preview video playback syncing
- Syncs the videos on new video creation
- Adds button to force the sync and reset playback time of all video previews
2023-10-05 22:49:48 +03:00
Jedrzej Kosinski 4830f195c3 Merge branch 'main' into cv_loadvideo 2023-09-29 00:01:11 -05:00
Austin Mroz 46b2e67a68 Implement folder upload 2023-09-27 15:56:51 -05:00
Austin Mroz e1443b9cef Add upload button to Load Video 2023-09-27 03:16:23 -05:00
Austin Mroz 2d2d2521e2 Fix width/height order of tensor in load video
Update element name in animation preview code.
2023-09-25 22:36:04 -05:00
Austin Mroz 278fb3c4a6 Cleanup and migration
Removed uneeded AnimateDiff nodes
Add scaffolding
Modify names
2023-09-23 19:50:05 -05:00
Austin Mroz 3431f48cd7 Raise upper limit on decoding of metadata
The base implementation from pngs uses String.fromCharCode,
but that causes overflow from having too many arguments when decoding
video files, likely since no chunking is done and everything is embedded
as a single monolithic json

As an additional benefit, data is now properly decoded from utf-8
instead of being interpreted as utf-16
2023-09-22 20:32:46 -05:00
Austin Mroz c6ab9e48bd Add max metadata limit
Better handling for a canceled "load file" dialogue
Remove some remaining js logging
2023-09-21 22:28:08 -05:00
Austin Mroz b6d1d3ed21 Implement mp4 loading, fix webm size 2023-09-21 21:55:58 -05:00
Austin Mroz 679b496222 Initial metadata support for videos
Additional testing is pending, but a workflow ending in a AnimateDiff
Combine was able to be successfully restored
2023-09-21 16:47:38 -05:00
kijai c6d34350df Added changes made on top of this on the original main repo
This fixes the node scaling and combines everything to one node with format options.
2023-09-18 13:55:14 +03:00
kijai 6531442ec3 Add webm node preview
added video preview to the node, with pingpong loop option
2023-09-16 19:46:49 +03:00
kijai 1ea1e8f6c1 Update gif_preview.js
Fix node/widget removal
2023-09-15 21:40:15 +03:00
kijai f524bca3d0 First working gif preview
javascript code is pretty much directly from mtb node's "save gif" widget extension code
2023-09-15 21:19:05 +03:00