diff --git a/js/comfyui-manager.js b/js/comfyui-manager.js index 1da642af..4e258266 100644 --- a/js/comfyui-manager.js +++ b/js/comfyui-manager.js @@ -2092,7 +2092,12 @@ app.registerExtension({ ShareDialog.instance = new ShareDialog(); } - app.graphToPrompt().then(prompt => app.graph._nodes).then(nodes => { + app.graphToPrompt().then(prompt => { + console.log({prompt}) + return app.graph._nodes; + }).then(nodes => { + console.log({nodes}); + const potential_outputs = []; const potential_output_nodes = []; diff --git a/js/comfyui-share.js b/js/comfyui-share.js index 0ba6f701..54078622 100644 --- a/js/comfyui-share.js +++ b/js/comfyui-share.js @@ -2,6 +2,8 @@ import { app } from "../../scripts/app.js"; import { api } from "../../scripts/api.js" import { ComfyDialog, $el } from "../../scripts/ui.js"; +const VALID_OUTPUT_TYPES = ["SaveImage", "VHS_VideoCombine"]; + export class ShareDialog extends ComfyDialog { static instance = null; static matrix_auth = { homeserver: "matrix.org", username: "", password: "" }; @@ -110,9 +112,12 @@ export class ShareDialog extends ComfyDialog { } this.share_button.onclick = async () => { + alert("Clicked"); const prompt = await app.graphToPrompt(); const nodes = app.graph._nodes; + console.log({ prompt, nodes }); + const destinations = []; if (this.matrix_destination_checkbox.checked) { destinations.push("matrix"); @@ -141,7 +146,9 @@ export class ShareDialog extends ComfyDialog { // TODO: Add support for AnimateDiffCombine, etc. nodes that save videos/gifs, etc. for (let i = 0; i < nodes.length; i++) { const node = nodes[i]; - if (node.type !== "SaveImage") { + console.log({ node }); + + if (!VALID_OUTPUT_TYPES.includes(node.type)) { continue; } @@ -156,8 +163,13 @@ export class ShareDialog extends ComfyDialog { } } } + else if (node.type === "VHS_VideoCombine") { + potential_output_nodes.push(node); + } } + console.log({ potential_outputs, potential_output_nodes }) + if (potential_outputs.length === 0) { if (potential_output_nodes.length === 0) { // todo: add support for other output node types (animatediff combine, etc.)