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 }; }