Gifs were incorrectly being loaded by a video tag when advanced previews
was set to "Input Only" (the default). The logic for when advanced
previews are used as been clarified.
Resolves#435
Parameters that determine the output quality when advanced previews are
displayed have been moved to only be set when the request if for an
advanced preview. These were ignored when the request was made to the
default /view endpoint, but created undesirable clutter
The prior disconnection logic would eagerly disconnect if the type has
changed at all. In addition to providing awful quality of life, this
was also causing issue with workflows that contain an unbatch node being
saved at all.
The code for type cloning has undergone a substantial rewrite to
properly check link validity and to propogate link events
Resolves#432
Several nodes, like Load Video FFmpeg and Load Audio have a widgets that
take a time in seconds.
These are now handled by an updated widget that will display times as
hour:minutes:seconds and allow entry by hour:minutes:seconds
SetWidgetConfig is usable on widget options despite the type mismatch.
This provides a cleaner solution than a blind
Object.getOwnPropertySymbols call.
The prior code of parsing width traces all the way back to f63a0f78
I no longer recall the purpose of the slice, but parsing element
information to determine sizing is inherently flawed. An element width
will not exist until a preview has loaded. Instead, the element size is
back calculated from the node size.
The prior fix to respect rendering threshold had a number of mistakes.
Foremost, a typo in naming prevented it from applying at all. Path
widgets perform rendering separately and need an independent fix. The
comparison has additionally been changed to greater than or equals. This
is most noticeable when low_quality_zoom_threshold is set to 1.0
See #412
Core has staged a more robust implementation for parsing video metadata.
Once this been rolled out, it should be used instead of the `good
enough` implementation used by VHS.
The code for querying video information is an async function. Rather
than adding a setTimeout call, the function is simply called, but never
awaited.
Remove experimental from unbatch description
Adds a new node to select the most recently modified file of a target
folder. This can be used to automate using the output of one execution
as the input for another. In order to allow frontend values to properly
update, this is implemented as a virtual node, skeleton node def is
included due to difficulty with setting up the node as fully virtual.
This will likely be revisited in the future.
Add an optional length argument to path trimming. The original 30
character length estimate seems to no longer be accurate which results
in text overlapping. A more thorough investigation and fix will come
later.
Update experimental designation on nodes.
video_query data is deleted when a new preview is loaded. This ensures
old query information doesn't persist on failed load.
Call onRemove on removed output format widgets. This doesn't matter for
any existing formats, but swapping to app.widgets allows for arbitrary
widgets to be included in formats which may require it.
Remove the app argument from the VHSFLOAT and VHSINT widget
constructors. These constructors aren't actually used, but this change
brings there functionality closer in line with the upstream sentiment.
Format widgets which are numbers are now converted to be annotated
widgets. This ensures they have full access to VHS QoL in the future
even though none can make use of this functionality at present.
Sequential widget prompting with now check that the subsequent widget
has a mouse function before blindly calling, but is also lmited to only
annotated numbers for now. The distinction makes no difference for
existing nodes, but adds an additional layer of safety.
When a widget is clicked on a dialogue pops up to allow a value to be
typed. For numeric inputs on VHS nodes, pushing tab will now finalize
the input and create a new prompt for the next widget on the node.
Fix incorrect indentation.
mp4 files are parsed separately from webm files. The prior commit
changed the parsing to directly pass the workflow content, but failed to
make an equivalent change in the mp4 parsing code.
As a fix, the full dict containing metadata information is now returned
as before and native videos are simply wrapped.
Resolves#393
Core has added experimental support for outputting video, but does not
support loading it yet. VHS currently swallows any video files it can
not find metadata in. Once ComfyUI adds support for loading it's own
video files, this will result in an awkward period where VHS breaks
loading of core ComfyUI video files.
Instead, I've just implemented support for loading workflows from videos
output by ComfyUI.
injectHidden was previously used to hide the custom width and custom
height widgets when they had been disabled by force_size.
As this functionality has been removed, this is dead code and can be
removed as well.
Now that passing of information has been simplified, it's handling can
also be cleaned up. The new code should have no functional difference
but is vastly shorter.
Because the functionality has not changed, this still does not require a
reload.
Format widgets are now stored in the options of format widget instead of
the name.
This code has been prepped to execute without requiring a webpage reload
unless a user has not updated in the week prior to this commit.
A minor js change is made to allow for a change in format to function
without recreated nodes, but this will be phased out immeidately now
that the code for format selection can be simplified
See ffbc27304
When format widgets were initially introduced, node defs were only
partially updated when a refresh node def operation was performed. As a
workaround, format widgets include this additional information in names
of the selections. This less than desirable and should be phased out.
As every single update has had users that fail to reload the page and
run old javascript, I plan to release this change in three phases.
- (this commit) Check for format widget definitions in format widget
options as well.
- Modify the format widget defs to be included in the options instead of
names
- Only check for format widget defs in options and remove the code for
parsing names
When a format like AnimateDiff or None is selected that do not put
restrictions on frames is used, it is still useful to see the number of
frames available
NOTE: the number of frames will go negative if skip_first_frames or
start time is too high. It's easy to restrict this to 0, but I'm leaving
it in for now as I consider it useful information.
While 1 second is a reasonable step for start time, this setting was
causing undesiable rounding and truncating of precision. The precision
has been manually increased to 3 decimal places while maining the 1
second step
The vae input was broken for the ffmpeg nodes and the Load Image (path)
nodes. basic operation is fixed, but the mask output is currently
disabled while in use and will require further attention.
Since the Path and Upload nodes have different processing needs for
source selection, this isn't handled in the common load video code.
Previously, this code was executed after which meant that the initial
state isn't recorded when the common load code triggers callbacks for
each widget.
Generating accurate frame counts becomes fairly involved when other
widgets are modified that affect frame number. In an effort to
centralize this frame count logic, the loaded number of frames is now
calculated on the backed queryvideo call and this number is then
displayed on in the annotation.
Add try/catch loop to the queryvideo call. This failing is expected if
the ComfyUI server is restarting or down and this ensures exception
doesn't propagate and cause issues elsewhere
Nodes that are added, rather than being restored do not have configure
called and thus do not have their callbacks triggered. The addLoadCommon
method used to initialize the Load Video nodes will now explicitly
trigger the callback on every non video widget at the end to ensure it's
done in a unified singular spot.
The frame_load_cap widget will now display the actual number of frames
that will be loaded if it differs from the selection
The queryvideo endpoint now wraps its information under a source item.
If information is later added to process other query args, those may can
now be added under a loaded item instead.
Add default resolutions to each of the load video formats and added
shorhand code for assigning them
force_size is now checked for and a warning is displayed if it is used.
Users not reloading the webpage after installing an update is a
recurring issue.
A previous attempt to update the load format code to prevent defaults
from being clobbered was mistakenly added to the wrong function. This
has been fixed.
The callback to restrict widget values to number + modulus now
explicitly always allows 0
frame_load_cap now has an added annotation to disable
Prior commit was flawed, a node is not configured until after all
onNodeCreated fire. Performing callbacks prior to this moment is wasted.
Instead, the KV state code performs this callback but with an added
guard to ensure that buttons aren't clicked.
The ordering for adding callbacks for node functionality was ill thought
out. This both made initial loads unreliable and resulted in many places
in the code were unnecessary delays were added with
requestAnimationFrame or setTimeout.
Remove the callback from key/value setup. This was causing buttons to be
clicked and was merely masking issues elsewhere.
Refactor _addVideoPreview back in. The video preview code was briefly
used for the implementation of latent previews, but the released code
uses images and the separation no longer has purpose.
Functioning server code was in place to pull image_load_cap and
skip_first_images when processing previews in the Load Images nodes, but
these args where being redirected to function on the images after they
have been converted into a video. This was causing issues, so this
remapping has been disabled.
Resolves#368
Added a check to ensure a format input exists on load nodes before
trying to initialize it.
The type of an annotated widget has been changed to BOOLEAN so that it
isn't a known Litegraph type, but is still a valid type for widget
conversion. This will require further testing to ensure it doesn't break
anything.
Annotated numbers converted from floats can now connect to both INT and
FLOAT types.
See #365
Fixed a bug where Load Formats prevented a node from being cloned
Known issue: Cloning a Load Video (Upload) node with alt+drag seemingly
triggers the file upload dialogue.
Load formats provided by VHS are now stored separate from those other
extensions can potentially provide. This ensures the formats built in to
VHS can't get clobbered by other devs blindly copying VHS code.
Aspect ratio is again tracked to determine when previews need to be
updated.
Further input tweaks: The 8x step has been removed from dimensions so a
user can opt into other dimensions when no format is selected.
frame_load_cap is now marked as being disabled when set to 0.
A request animation call used to initialize state after widget values
are set has been changed to a timeout. There's some unreliability here
which warrants further investigation, but this is much more reliable for
the interim.
HTML source elements claim to provide a way to have different priorities
for videos served. I had hoped that this would provide a way to minimize
the chances that a users configuration would result in previews failing
to display, but from testing, this appears to be quite unreliable.
updating the src on source elements doesn't cause the browser to
recheck which source items are valid and and I noticed requests
persisting after elements have been removed.
Since this update set is already becoming larger than expected, I plan
to revisit this functionality at a later date.
Functionality to skip encoding in the video preview endpoint has been
reduced. This functionality created security concerns by exposing read
access to any file on the users system. Instead, it only displays files
that already can be handled by the native view endpoint and only
executes in the fringe case that a user install is incomplete and ffmpeg
is unavailable.
Further old code related to force_size has been removed. The viewvideo
endpoint will likely be changed in the future as well, but I'm more
cautious of other custom nodes that leverage this endpoint.