fix: switching workflows will no longer turn off previews #477
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #364
Bug/Reproduction
Please note that having animated previews enabled breaks even non-animated previews.
Identified cause
VHS_latentpreviewevent, which is run once per generation, detects the currently executing node. SinceVHS_latentpreviewis emitted by theget_previewerin the latent_preview Python module, this executing node will always be some sort of sampler.node#addDOMWidgetto add to the node the widget that shows previews capable of displaying videosnode#addDOMWidgetin some location that is run even on workflow switch, but since this way of adding video-capabilities to previews is node-agnostic, we are using it inside this event where it won't work on workflow switch)Fix
I changed
animateInterval, which updates the displayed image, such that before updating the image, we check whether the currently executing node still has its widget; if not, we re-add the widget first.For users: How to get this fix
If this PR has been merged, or the author has closed it and implemented their own fix, ensure you are using the latest nightly version of the node pack.
If this PR has not been merged, navigate in the command line to
ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite/(orcomfyui-videohelpersuite, check which one applies for you), then run:If you experience issues in the future because the official fix is incompatible with mine, reinstall the nodepack.