From 2484ac97aeea60696c273acacd9eb060396b163e Mon Sep 17 00:00:00 2001 From: thecooltechguy Date: Thu, 23 Nov 2023 23:20:20 -0800 Subject: [PATCH 1/2] add support for sharing outputs of the new SaveAnimatedWEBP node --- js/comfyui-share.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/js/comfyui-share.js b/js/comfyui-share.js index 9ea8aef0..6e45e9b8 100644 --- a/js/comfyui-share.js +++ b/js/comfyui-share.js @@ -7,6 +7,7 @@ export const SUPPORTED_OUTPUT_NODE_TYPES = [ "SaveImage", "VHS_VideoCombine", "ADE_AnimateDiffCombine", + "SaveAnimatedWEBP" ] var docStyle = document.createElement('style'); @@ -33,6 +34,7 @@ docStyle.innerHTML = ` document.head.appendChild(docStyle); export function getPotentialOutputsAndOutputNodes(nodes) { + console.log({ nodes }); const potential_outputs = []; const potential_output_nodes = []; @@ -88,7 +90,7 @@ export function getPotentialOutputsAndOutputNodes(nodes) { const widgetValue = node.widgets[j].value; const parsedURLVals = widgetValue.params; - if(!parsedURLVals.format.startsWith('image')) { + if (!parsedURLVals.format.startsWith('image')) { // video isn't supported format continue; } @@ -126,6 +128,17 @@ export function getPotentialOutputsAndOutputNodes(nodes) { } } } + else if (node.type === "SaveAnimatedWEBP") { + potential_output_nodes.push(node); + + // check if node has an 'images' array property + if (node.hasOwnProperty("images") && Array.isArray(node.images)) { + // iterate over the images array and add each image to the potential_outputs array + for (let j = 0; j < node.images.length; j++) { + potential_outputs.push({ "type": "image", "image": node.images[j], "title": node.title }); + } + } + } } return { potential_outputs, potential_output_nodes }; } From 33fceda559db3089a5a5195a401bd1f48bd70e31 Mon Sep 17 00:00:00 2001 From: thecooltechguy Date: Thu, 23 Nov 2023 23:22:02 -0800 Subject: [PATCH 2/2] remove console log --- js/comfyui-share.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/comfyui-share.js b/js/comfyui-share.js index 6e45e9b8..ff38a52e 100644 --- a/js/comfyui-share.js +++ b/js/comfyui-share.js @@ -34,7 +34,6 @@ docStyle.innerHTML = ` document.head.appendChild(docStyle); export function getPotentialOutputsAndOutputNodes(nodes) { - console.log({ nodes }); const potential_outputs = []; const potential_output_nodes = [];