The old preview method stored the url instead of the params.
This makes it non trivial to parse whether it was to an image or video.
For safety, this information is instead discarded.
computeSize now calculates directly from the nodes width instead of
saving the width from the last draw operation. This fixes a race
condition when a video loads before the draw frame occurs.
the paused and hidden state of a preview widget are now serialized as
part of the vlaue. This means they survive reload or restoring a
workflow. Addionally, videos are paused before being hidden to improve
performance on some browsers.
A frustrating amount of digging with an awfully simple solution.
The current selected widget for mouse events is held in
app.canvas.node_widget.and clearing it prevents the continued
propagation of move events to parent widgets.
Also provides a minor fix for canceled file uploads
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.
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.
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.
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
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.
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
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.