1 Star 0 Fork 15

雪狐/ComfyUI_Lam_1

forked from yanlang0123/ComfyUI_Lam 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
StatusInfo.js 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
马噥 提交于 2024-01-18 22:25 +08:00 . 插件升级,添加百度翻译和本地翻译
import { app } from "/scripts/app.js";
import { ComfyWidgets } from "/scripts/widgets.js";
// Displays input text on a node
app.registerExtension({
name: "StatusInfo",
async beforeRegisterNodeDef(nodeType, nodeData, app) {
var names=["Image2Video",'Video2TalkingFace','VideoAddAudio','Image2TalkingFace','ForEnd','LoadVideo','VideoFaceFusion',
'Text2AutioEdgeTts','VideoRoopFaceSwap','PromptTranslator']
if (names.indexOf(nodeData.name)>=0) {
// When the node is created we want to add a readonly text widget to display the text
const onNodeCreated = nodeType.prototype.onNodeCreated;
nodeType.prototype.onNodeCreated = function() {
const r = onNodeCreated?.apply(this, arguments);
const w = ComfyWidgets["STRING"](this, "StatusInfo", ["STRING", { multiline: true }], app).widget;
w.inputEl.readOnly = true;
w.inputEl.style.opacity = 0.6;
return r;
};
// When the node is executed we will be sent the input text, display this in the widget
const onExecuted = nodeType.prototype.onExecuted;
nodeType.prototype.onExecuted = function(message) {
onExecuted?.apply(this, arguments);
for (let i = 0; i < this.widgets.length; i++) {
if(this.widgets[i].name=='StatusInfo'){
if(message?.text){
this.widgets[i].value = message.text.join('');
}
break;
}
}
if (this.size[1] < 200) {
this.setSize([this.size[0], 200]);
}
};
}
},
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/assassindesign/ComfyUI_Lam_1.git
git@gitee.com:assassindesign/ComfyUI_Lam_1.git
assassindesign
ComfyUI_Lam_1
ComfyUI_Lam_1
cu121

搜索帮助