Commit Graph
133 Commits
Author SHA1 Message Date
Austin Mroz e4d7c30ac3 Merge minor outstanding changes 2024-08-07 14:58:30 -05:00
Austin Mroz 013473335a Fix clobbering of OnDrawForeground
Bizarrely, setting the prototype for onDrawForeground was resulting in
the onDrawForeground function getting clobbered if another extension
(such as Jovimetrix) adds a function to onDrawForeground, even if
the standard wrapping procedures was done. This patch fixes both this
incompatibility, and the callback being applied multiple times for each
node created
2024-08-07 14:49:46 -05:00
Austin Mroz 5aa08cb61b Remove when hovering in the documentation window
Previously, the title attribute was used to link a selected widget to
the correct spot in the documentation, but this had the side effect of
causing a tooltip to appear when the documentation itself was moused
over. Since this tooltip would block the documentation text itself and
provide no useful information to the user, this lookup information is
now stored as vhs_title attribute
2024-08-07 13:32:14 -05:00
Austin Mroz 0e0bcc72f8 Add simple description formatting if plaintext.
If the description doesn't have any children elements when interpreted
as html, it is assumed to be plaintext and has some basic formatting
applied. New lines are replaced with a <br> tag so they function as
expected and the first line is used as a short description for the node,
which shows when the title is moused over, or when selecting the node in
the search box.

If desired, this could be expanded to apply simple markdown formatting
such as lists or titles.
2024-08-07 13:23:51 -05:00
Austin Mroz e667990015 Add toggles for muting video previews
To better facilitate working with audio, videos previews were changed to
unmute when moused over, but it has been requested multiple times that
an option be added to have the previews remain muted. This is now added
in two forms: A UI setting like Advanced Previews to have new previews
default to muted on creation, and a Right Click option to toggle the
mute state on individual previews.
2024-08-06 21:46:15 -05:00
Austin Mroz 8e774e44ce Add image function for documenation, fix path api
A helper function has been added to assist in adding images to
documentation

A preceding forward slash is required when using the new ComfyUI
frontend. Since this was missing from the call to fetch files for path
widgets, they weer not functioning as expected.
2024-08-06 21:30:24 -05:00
Austin Mroz 12b9f8d00f Formatting, minor fixes
Add check for null when pulling short description

Split the test description into multiple lines to clean up diffs

Stop decreasing size after an arbitrary depth

Include example of documenting widget values
2024-08-05 15:19:23 -05:00
Austin Mroz 8a564019ef After load, use human readable description.
In the new frontend, the DESCRIPTION field is being used for
standardized basic documentation. To keep the more advanced features
of this branch, a short human readable  description can now be
derived from the full description. After initial load, the description
field is replaced from this shorter description.
2024-08-05 14:50:21 -05:00
Austin Mroz 3dc15c4507 Refactor for code sharing
Wrap computeSize so that the question mark doesn't overlap with the
node title
2024-08-04 04:01:20 -05:00
Austin Mroz 3489bccd20 Fix text reflow, collapse size, scrollbar
Rather than adjusting font size, a transformation is applied to the div
itself, preventing reflow on zoom

The expand/collapse button is now only clickable on the text itself

Basic styling has been applied to the scrollbar when needed
2024-08-04 02:23:00 -05:00
Austin Mroz fc328d88ce Additional fix for loading API workflows 2024-07-30 14:36:52 -05:00
Austin Mroz 7c313fd9fb Merge ytdl_support, audio QOL 2024-07-30 02:36:13 -05:00
Austin Mroz 9405e803c2 Forcibly restore input type, test audio exists
When loading a workflow from before when VHS_AUDIO was swapped for
AUDIO, the input type of VideoCombine nodes would be set to VHS_AUDIO
despite this being invalid. This has now been fixed.
See #254

With the change to AUDIO, an error is now raised when audio doesn't
exist but an audio connection is used. This is necessary to ensure
correct error handling with nodes outside VHS. However, this
inconveniences those who always connect the audio input directly to
video combine. To resolve this, Video Combine now catches the thrown
error and skips embedding audio if needed.
Resolves #258
2024-07-30 02:17:27 -05:00
Austin Mroz 990e6e2448 Fix loading of API workflows 2024-07-30 01:40:39 -05:00
Austin Mroz 3a906cfe8f Close help if the node is removed 2024-07-26 19:31:50 -05:00
Austin Mroz a0f616cbef Implement collapsing
Adjust offset when selecting inputs
2024-07-26 16:12:18 -05:00
Austin Mroz 1e9f7e7257 POC node documentation implementation.
Nodes with a DESCRIPTION variable have that variable displayed as raw
html. A documentation file has been added to assist in
mocking documentation in a standardized format.

Logic to allow connecting node interaction to equivalent documentation
is partial. Currently, the hovered item is highlighted, but the intent
is to either automatically scroll to the selected region, or collapse
other regions.
2024-07-26 01:30:34 -05:00
Austin Mroz d6ac0b999b After upload, use name provided by upload endpoint
By default, If an uploaded file has the same name as an already existing
file, a number is appended to the end and the new name is returned by
the endpoint. When this occurs, modified filename is now properly added
to the filelist and swapped to.
2024-07-18 03:12:55 -05:00
Austin Mroz e1c4e939ec Workaround for DeepFuze overriding onExecuted
DeepFuze overrides onExecuted on every node, doesn't chain existing
callbacks, and raises an exception if the node doesn't have the expected
audio variables.

In order to prevent loading order shenanigans. This has been by fixed by
wrapping the function to not apply on VHS namespaced nodes.

See #242
2024-07-15 14:58:45 -05:00
Austin Mroz bd5381ec8f Add safety check to VHS_AUDIO link check
Add safety check that the connected node has a nodeDef.
See #249
2024-07-10 13:04:40 -05:00
Austin Mroz ce5d0a7548 Fix dragging and scrolling on previews 2024-07-09 11:35:03 -05:00
Austin Mroz 962e8e86ef Migrate from VHS_AUDIO to built-in AUDIO
Merge branch 'audio_format'
2024-07-05 18:38:53 -05:00
Austin Mroz e23ec8befd Unmute video on mouseover
Video previews unmute when moused over.

Advanced previews now have audio included when encoded.

Fixed yet another bug with custom_size on Load Video
2024-07-05 18:28:57 -05:00
Austin Mroz 0037f49aee Add check for null in cg-use-everywhere workaround
Resolves #241
2024-06-30 23:02:54 -05:00
Austin Mroz 3258f3cac5 Add temporary workaround for cg-use-everywhereo
cg-use-everywhere automatically creates links when when a graph is
executed. This is generally nice utility, but conflicts with the
paradigm of the new VAE inputs and is particularly problematic for Load
Video (where it can not be solved on the python side).

As a workaround, a wrapper is added around the graphToPrompt call that
cg-use-everywhere wraps which deletes any links from LoadVideo nodes
that do not actually exist.
2024-06-30 01:10:25 -05:00
Austin Mroz ad3b48fe89 Warn user of nodes using legacy VHS_AUDIO
Some external nodes have adopted the usage of VHS_AUDIO for user
convenience. If these nodes do not update, then a AudiotoVHSAudio node
must be added to perform the conversion. The code to check pulls up the
nodeDef and will not warn on old workflows if the target node has been
updated.

The conversion node is not automatically added. While this may be
feasible, I feel it would be overly destructive, error prone, and would
require logic for where to fit the conversion node into a workflow
visually. A gentle warning seems the safer option.
2024-06-29 12:55:37 -05:00
Austin Mroz 9273fcbeff Fix misconverted inputs on migrated workflows
When an old workflow is loaded with converted widgets, those converted
widgets can take the vae slot and convert the image input to a latent
input. An explicit check is added to make sure the slot that is
connected has type VAE to fix these converted workflows.
2024-06-27 03:15:55 -05:00
Austin Mroz 61e1d4c2c2 Image sequence preview: frame rate, context menu
Frame rate is now passed so image_sequqnces play back at proper rate.

Context menu options on an image sequence (open preview, save) now
operate on the first frame instead of throwing an error.
2024-06-18 16:18:48 -05:00
Austin Mroz 037c4f53ed Fix links breaking on load for Load Video/Combine 2024-06-18 15:54:24 -05:00
Austin Mroz c7e2172bcf Type Validation workaround, improved link logic
ComfyUI does type validation that I by stoke of luck, completely missed
while working on implementation. As a work around, load video and video
combine have an extra input/outpu of the latent type that is hidden and
links are modified to point use those on serialization.
The logic for when links should be maintained has been improved.

latent links seem to always be broken on reload, likely because the link
type is incorrect at link creation time. Further investigation needed
2024-06-17 02:23:31 -05:00
Austin Mroz 78665f68e8 POC load_latent rewrite
Adds an optional vae input to Load Video and Video Combine. When this is
connected, the node is dynamically updated such that Load Video instead
has a latent output and Video combine instead has a latent input.
2024-06-11 12:42:07 -05:00
Kijai a81be0b8c5 Fixes 2024-04-17 11:34:46 +03:00
Kijai b2fde5abde Add LoadAudioUpload -node 2024-04-16 17:39:54 +03:00
Austin Mroz 47c7f9a78e Force migrate batch_manager inputs to meta_batch
When loading graph data, the "name" field on inputs is overwritten to
the name data saved in the workflow. As old workflows utilizing these
meta batches have the old batch_manager name, the input is loaded to
it's old name which would cause an error on execution.

Instead, quick javascript code has been added to manually force the
update of these inputs.
2024-04-09 11:46:54 -05:00
Austin Mroz 38618d4eae Fixes for batch_manager error handling
stdin is always flushed before yeilding. While this loses some potential
speedup by processing video output on cpu while the gpu is processing
the next batch of frames, it is likely incompatible with errors related
to metadata which could not be replicated. For now, stdin is flushed to
reduce the likelihood of regression.

Fixed a mistaken ordering in the batch_manager node causing the
unique_id to be overwritten.

Re-add the dummy count value to the batch manager node in js. Without
it, an error during the first batch step will result in teh batch
manager node not being marked as stale. Since the batch_manager node
exists only as an optional input, IS_CHANGED will never be called and
there must be some external change to ensure it is still marked stale
2024-01-29 20:50:31 -06:00
Austin Mroz af3f0c1be4 Migrate re-queues to occur on server side
Terminate batch when any input closes
2024-01-29 16:15:12 -06:00
Austin Mroz 60cdc6c8bc Batch Manager supports multiple inputs and outputs
Also removes the use of a static batch_manager instance
2024-01-25 01:08:38 -06:00
Austin Mroz c5de20d0bf Initial proof of concept for Batch Management
Processing video can have prohibitively high memory requirements.
This commit introduces a system for dividing the processing of a video
input into multiple workflow executions.

To accomplish this, the reference to the cv2 video_capture instance, and
the ffmpeg subprocess are kept open and the workflow is automatically
re-executed for each partial step.
2024-01-23 23:47:36 -06:00
Austin Mroz aca4dfcdac Update preview on Upload
Previously, Load Video (Upload) and Load Images (Upload) would swap to
the new file or folder, but would not update the preview. They have both
been fixed.
2024-01-18 16:03:03 -06:00
Austin Mroz 97fbebd3af Restore preview display when zoomed out.
In switching to video previews to use DOMWidgets, the performance
optimization to hide elements when zoomed out was left enabled by
default. This hiding has been disabled to restore prior functionality.
2024-01-17 17:34:23 -06:00
Austin Mroz 48f7b5e2f4 Add hotkey to disable PathWidget extension filters
Load Video and Load Audio both function with inputs not officially
listed as supported. Load Video can be used to load image files as a
substitute for Load Image and Load Audio can be passed video files.

While users have always had the option to manually type the path to a
filetype not ostensibly supported, this can be inconvenient.

A hotkey (Ctrl+g) has been added to temporarily disable the extension
filtering.
2024-01-15 22:14:35 -06:00
Austin Mroz ff59a789c9 Initial DOMWidget migration
Migrates preview widgets to use the ComfyUI DOMWidgets implementation.
This resolves a number of issues with flickering, adds support for DOM
element clipping, and should have better compatibility with future
updates.

resolves #128

Fixes to logic for determining when the aspect ratio of a video preview
has changed.
2024-01-13 20:28:28 -06:00
Austin Mroz 6ec9bdf17f Only reload preview if aspect ratio would change
Previously, any change to force_size, custom_width, or custom_height
would cause the video preview to reload. This has been changed to only
reload the preview if a change of values has occurred that could change
the aspect ratio.
2024-01-09 22:19:27 -06:00
Austin Mroz 625d43e31d Pass custom_width and custom_height to python code
Before, custom_width and custom_height widgets were virtual widgets that
were used to generate an equivalent force_size value on serialization.

This logic has been moved to the python side, but is largely unchanged
for simplicity.

This allows for custom_width and custom_height to be converted to an
input and set by output from python code which is not known before
execution.

resolves #119
2024-01-08 16:12:45 -06:00
Austin Mroz 9f0526a766 Fix error on iteration of VHS node with no widgets
Resolves #107

Fix error message for failed late validation of load video path
2023-12-28 11:14:11 -06:00
Austin Mroz 9234d91a2b Fix widget conversion
After substantial rewriting, paths are declared as strings in the python
code, and converted to path widgets in the webui if they include an
option for vhs_path_extensions. resolves #104

VALIDATE_INPUT and IS_CHANGED for path nodes were rewritten and largely
consolidated in utils to accommodate validation of inputs not known before
execution.
Known issue: VALIDATE_INPUT is never called for load_audio which results
in error messages that aren't very helpful if a bad path is provided

An error is no longer immediately raised if ffmpeg is not found

Internal paths are now absolute for load images advanced previews
2023-12-27 21:00:45 -06:00
Austin Mroz 3aeda1ffd5 Support converting VHSPATH widget to string input 2023-12-27 13:03:41 -06:00
Austin Mroz a4bd717116 Restore Video Combine previews persisting reloads 2023-12-26 19:58:45 -06:00
Jedrzej Kosinski 00b3d9593b made Advanced Preview setting name have the matching VHS emoji prefix to match format of other custom node settings 2023-12-26 15:57:39 -06:00
Austin Mroz 04a7000152 Switch to ComfyUI filename formatting
resolves #92
2023-12-24 02:16:01 -06:00