From 334692eb1a0c7d839c741dd2df4d950632c53aa2 Mon Sep 17 00:00:00 2001 From: space-nuko <24979496+space-nuko@users.noreply.github.com> Date: Mon, 19 Jun 2023 19:21:11 -0500 Subject: [PATCH] Workflow serialization fix ensure user data for values in workflow isn't stripped --- litegraph | 2 +- src/lib/nodes/widgets/ComfyWidgetNode.ts | 5 ----- src/lib/widgets/GalleryWidget.svelte | 10 ++-------- src/tests/ComfyGraphTests.ts | 23 ++++++++++++++++++++++- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/litegraph b/litegraph index 7c38fa4..29a7877 160000 --- a/litegraph +++ b/litegraph @@ -1 +1 @@ -Subproject commit 7c38fa4aedb33c960806efad6d700ec8ca67649f +Subproject commit 29a7877f598fe47d39d4531385a3ff6728a81673 diff --git a/src/lib/nodes/widgets/ComfyWidgetNode.ts b/src/lib/nodes/widgets/ComfyWidgetNode.ts index a0c3c8a..5bb2a83 100644 --- a/src/lib/nodes/widgets/ComfyWidgetNode.ts +++ b/src/lib/nodes/widgets/ComfyWidgetNode.ts @@ -357,9 +357,4 @@ export default abstract class ComfyWidgetNode extends ComfyGraphNode { this.value.set(value); this.shownOutputProperties = (o as any).shownOutputProperties; } - - override stripUserState(o: SerializedLGraphNode) { - super.stripUserState(o); - (o as any).comfyValue = LiteGraph.cloneObject(this.properties.defaultValue); - } } diff --git a/src/lib/widgets/GalleryWidget.svelte b/src/lib/widgets/GalleryWidget.svelte index 0ce01ee..4e49844 100644 --- a/src/lib/widgets/GalleryWidget.svelte +++ b/src/lib/widgets/GalleryWidget.svelte @@ -42,7 +42,7 @@ $: { previewURL = $queueState.previewURL; - if (previewURL && $queueState.runningPromptID != null && !$uiState.hidePreviews && node.properties.showPreviews) { + if (previewURL && $queueState.runningPromptID && !$uiState.hidePreviews && node.properties.showPreviews) { const queueEntry = queueState.getQueueEntry($queueState.runningPromptID) if (queueEntry != null) { const tags = queueEntry.extraData?.extra_pnginfo?.comfyBoxPrompt?.subgraphs; @@ -51,12 +51,6 @@ previewImage = img; }) } - else { - previewImage = null; - } - } - else { - previewImage = null; } } else { @@ -155,7 +149,7 @@