Merge pull request #186 from thecooltechguy/main

Add support for sharing outputs of the new SaveAnimatedWEBP node
This commit is contained in:
Dr.Lt.Data 2023-11-24 22:47:40 +09:00 committed by GitHub
commit e5dee1e6b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@ export const SUPPORTED_OUTPUT_NODE_TYPES = [
"SaveImage", "SaveImage",
"VHS_VideoCombine", "VHS_VideoCombine",
"ADE_AnimateDiffCombine", "ADE_AnimateDiffCombine",
"SaveAnimatedWEBP"
] ]
var docStyle = document.createElement('style'); var docStyle = document.createElement('style');
@ -88,7 +89,7 @@ export function getPotentialOutputsAndOutputNodes(nodes) {
const widgetValue = node.widgets[j].value; const widgetValue = node.widgets[j].value;
const parsedURLVals = widgetValue.params; const parsedURLVals = widgetValue.params;
if(!parsedURLVals.format.startsWith('image')) { if (!parsedURLVals.format.startsWith('image')) {
// video isn't supported format // video isn't supported format
continue; continue;
} }
@ -126,6 +127,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 }; return { potential_outputs, potential_output_nodes };
} }