ComfyUI/web/extensions/send_to_button/send_to_button.js

25 lines
829 B
JavaScript
Vendored
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { app } from "/scripts/app.js";
app.registerExtension({
name: "SendToLoadImage",
async nodeCreated(node) {
if (node.comfyClass === "SaveImage") {
node.onExecuted = (output) => {
if (!output?.images) return;
// Crée un bouton une seule fois
if (!node.sendBtn) {
const btn = document.createElement("button");
btn.innerText = "Send To...";
btn.style.margin = "5px";
btn.onclick = () => {
alert("Ici tu pourras choisir vers quel TaggedLoadImage envoyer limage");
};
node.addDOMElement(btn);
node.sendBtn = btn;
}
};
}
}
});