Download frontend/src/lib/compare-video-node.ts from turtle89431/Moxie-Multimedia: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/turtle89431/Moxie-Multimedia/resolve/main/frontend/src/lib/compare-video-node.ts
- Command line
-
hf download hf://turtle89431/Moxie-Multimedia/frontend/src/lib/compare-video-node.ts
-
curl -L -o compare-video-node.ts https://huggingface.co/turtle89431/Moxie-Multimedia/resolve/main/frontend/src/lib/compare-video-node.ts
1.24 kB
| interface CompareVideoWidget { | |
| name?: string | |
| } | |
| interface CompareVideoNodeInstance { | |
| hideOutputImages?: boolean | |
| onDrawBackground?: (context: CanvasRenderingContext2D) => void | |
| widgets?: CompareVideoWidget[] | |
| removeWidget?: (widget: CompareVideoWidget) => void | |
| videoContainer?: HTMLElement | |
| imgs?: unknown[] | |
| } | |
| interface CompareVideoNodeType { | |
| prototype: object | |
| } | |
| interface CompareVideoNodeDefinition { | |
| name?: string | |
| } | |
| export function suppressCompareVideoDefaultPreview( | |
| nodeType: CompareVideoNodeType, | |
| nodeData: CompareVideoNodeDefinition, | |
| ): void { | |
| if (nodeData.name !== 'easy compareVideos') return | |
| const prototype = nodeType.prototype as CompareVideoNodeInstance | |
| prototype.hideOutputImages = true | |
| prototype.onDrawBackground = function hideCompareVideoOutputPreview() { | |
| const defaultPreview = this.widgets?.find((widget) => widget.name === 'video-preview') | |
| if (defaultPreview && this.removeWidget) { | |
| try { | |
| this.removeWidget(defaultPreview) | |
| } catch (error) { | |
| console.error('[CompareVideoWidget] failed to remove the default video preview:', error) | |
| } | |
| } | |
| this.videoContainer?.replaceChildren() | |
| this.videoContainer = undefined | |
| this.imgs = undefined | |
| } | |
| } | |