1 Star 0 Fork 0

comfyui_custom_nodes/ComfyUI-ExLlama-Nodes

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
text.js 939 Bytes
一键复制 编辑 原始数据 按行查看 历史
import { app } from "../../../scripts/app.js";
import { ComfyWidgets } from "../../../scripts/widgets.js";
app.registerExtension({
name: "ZuellniText",
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 index = this.widgets.findIndex((w) => w.name === "output");
if (index !== -1) {
for (let i = index; i < this.widgets.length; i++)
this.widgets[i].onRemove?.();
this.widgets.length = index;
}
const options = ["STRING", {multiline: true }];
const widget = ComfyWidgets["STRING"](this, "output", options, app).widget;
widget.inputEl.readOnly = true;
widget.inputEl.style.opacity = 0.7;
widget.value = message.text;
}
};
}
},
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/comfyui_custom_nodes/ComfyUI-ExLlama-Nodes.git
git@gitee.com:comfyui_custom_nodes/ComfyUI-ExLlama-Nodes.git
comfyui_custom_nodes
ComfyUI-ExLlama-Nodes
ComfyUI-ExLlama-Nodes
main

搜索帮助