feature: .ccx download button in ComfyUI

This commit is contained in:
zombieyang
2024-07-16 18:50:04 +08:00
parent acc541e2ce
commit 697ed678bc
2 changed files with 30 additions and 6 deletions
+26 -2
View File
@@ -1,3 +1,4 @@
import { $el } from "../../../scripts/ui.js";
(async function() {
if (typeof gradioApp != 'undefined') return;
@@ -12,8 +13,32 @@
let socket = null;
console.log("[sd-ppp]", "Loading js extension");
const id = "Comfy.SD-PPP"
app.ui.settings.addSetting({
id,
name: "Download SD-PPP plugin",
type: (name, setter, value) => {
return $el("tr", [
$el("td", [
$el("label", {
for: id.replaceAll(".", "-"),
textContent: "Download SD-PPP plugin",
}),
]),
$el("td", [
$el("input", {
type: "button",
value: "Photoshop .ccx",
onclick: async () => {
location.href = "/extensions/sd-ppp/plugins/sd-ppp_PS.ccx"
},
})
])
])
}
})
app.registerExtension({
name: "Comfy.SD-PPP",
name: id,
init() {
},
async setup() {
@@ -86,7 +111,6 @@
if(onMouseEnter) await onMouseEnter.call(this, ...args);
this_handler.call(this);
}
}
}
});