Split nodes into files, allow loading each separately without cloning the repo, some other minor stuff, install exllamav2 pip package by default

This commit is contained in:
Zuellni
2023-10-07 10:56:18 +02:00
parent 796a6b8f25
commit 6e78068c1a
7 changed files with 198 additions and 180 deletions
+33
View File
@@ -0,0 +1,33 @@
import { app } from "../../../scripts/app.js";
import { ComfyWidgets } from "../../../scripts/widgets.js";
app.registerExtension({
name: "ZuellniTextPreviewer",
async beforeRegisterNodeDef(nodeType, nodeData, app) {
if (nodeData.name === "ZuellniTextPreviewer") {
const onExecuted = nodeType.prototype.onExecuted;
nodeType.prototype.onExecuted = function (message) {
onExecuted?.apply(this, arguments);
if (this.widgets) {
const position = this.widgets.findIndex((w) => w.name === "text");
if (position !== -1) {
for (let i = position; i < this.widgets.length; i++) {
this.widgets[i].onRemove?.();
}
this.widgets.length = position;
}
const type = ["STRING", { multiline: true }];
const widget = ComfyWidgets["STRING"](this, "text", type, app).widget;
widget.inputEl.readOnly = true;
widget.inputEl.style.opacity = 0.7;
widget.value = message.text;
}
};
}
},
});