From 681d4c67586a088f73af14cc4c7f2ab3a1817c5f Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Mon, 4 Aug 2025 14:57:54 -0700 Subject: [PATCH] [Bug] SaveAnimatedPNG node does not display generated APNG (#4197) Co-authored-by: github-actions --- src/services/litegraphService.ts | 9 ++++++--- src/stores/imagePreviewStore.ts | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/services/litegraphService.ts b/src/services/litegraphService.ts index 4a53ed448..c3d9994bb 100644 --- a/src/services/litegraphService.ts +++ b/src/services/litegraphService.ts @@ -847,10 +847,13 @@ export const useLitegraphService = () => { const isAnimatedWebp = this.animatedImages && - // @ts-expect-error fixme ts strict error - output.images.some((img) => img.filename?.includes('webp')) + output?.images?.some((img) => img.filename?.includes('webp')) + const isAnimatedPng = + this.animatedImages && + output?.images?.some((img) => img.filename?.includes('png')) const isVideo = - (this.animatedImages && !isAnimatedWebp) || isVideoNode(this) + (this.animatedImages && !isAnimatedWebp && !isAnimatedPng) || + isVideoNode(this) if (isVideo) { useNodeVideo(this).showPreview() } else { diff --git a/src/stores/imagePreviewStore.ts b/src/stores/imagePreviewStore.ts index b2c19b8f9..837895e40 100644 --- a/src/stores/imagePreviewStore.ts +++ b/src/stores/imagePreviewStore.ts @@ -21,7 +21,10 @@ const createOutputs = ( ): ExecutedWsMessage['output'] => { return { images: filenames.map((image) => ({ type, ...parseFilePath(image) })), - animated: filenames.map((image) => isAnimated && image.endsWith('.webp')) + animated: filenames.map( + (image) => + isAnimated && (image.endsWith('.webp') || image.endsWith('.png')) + ) } }