diff --git a/js/Canvas.js b/js/Canvas.js index c077851..25423cd 100644 --- a/js/Canvas.js +++ b/js/Canvas.js @@ -83,7 +83,7 @@ export class Canvas { dimensions: { width: this.width, height: this.height }, viewport: this.viewport }); - this.setPreviewVisibility(false); + this.previewVisible = false; } async waitForWidget(name, node, interval = 100, timeout = 20000) { const startTime = Date.now(); diff --git a/js/CanvasView.js b/js/CanvasView.js index c7513fb..e83da84 100644 --- a/js/CanvasView.js +++ b/js/CanvasView.js @@ -667,6 +667,10 @@ async function createCanvasWidget(node, widget, app) { node.setDirtyCanvas(true, true); } }; + // Inicjalizuj stan preview na podstawie aktualnej wartości widget'u + if (canvas && canvas.setPreviewVisibility) { + canvas.setPreviewVisibility(showPreviewWidget.value); + } } return { canvas: canvas, diff --git a/src/Canvas.ts b/src/Canvas.ts index 9cadfc3..944bc34 100644 --- a/src/Canvas.ts +++ b/src/Canvas.ts @@ -132,7 +132,7 @@ export class Canvas { viewport: this.viewport }); - this.setPreviewVisibility(false); + this.previewVisible = false; } diff --git a/src/CanvasView.ts b/src/CanvasView.ts index 595e878..3ad4878 100644 --- a/src/CanvasView.ts +++ b/src/CanvasView.ts @@ -730,6 +730,11 @@ async function createCanvasWidget(node: ComfyNode, widget: any, app: ComfyApp): node.setDirtyCanvas(true, true); } }; + + // Inicjalizuj stan preview na podstawie aktualnej wartości widget'u + if (canvas && canvas.setPreviewVisibility) { + canvas.setPreviewVisibility(showPreviewWidget.value); + } } return {