Kosinkadink / ComfyUI-VideoHelperSuite

Nodes related to video workflows
GNU General Public License v3.0
435 stars 76 forks source link

Video Previews flicker if node's node bounds are calculated between draws. #128

Closed rgthree closed 6 months ago

rgthree commented 6 months ago

Looks like the onBounding method on video preview moves the preview "offscreen" if called multple times before a draw is called.

https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite/blob/b86c1f9f4516faccb83c8957f0516443596def6b/web/js/VHS.core.js#L477-L481

This onBounding method is called whenever a nodes bounds is calculates by LiteGraph/ComfyUI, which is called whenever a group recomputes its nodes. In the case of rgthree-comfy's Fast Groups nodes, groups may calculate their nodes between when a video preview node is "drawn" causing flickering.

Source issue: https://github.com/rgthree/rgthree-comfy/issues/111

AustinMroz commented 6 months ago

Thanks for the report and analysis required to track the actual issue down.

I'm investigating migrating previews to use the ComfyUI DOMWidget which has proper handling for hiding elements of off-screen nodes.