mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-11 13:54:30 +08:00
Added GrowMaskWithBlur -node fixing set/get functionality, still buggy especially when loading workflows, added .js alert for the errors to troubleshoot
33 lines
970 B
JavaScript
33 lines
970 B
JavaScript
import { app } from "../../../scripts/app.js";
|
|
|
|
app.registerExtension({
|
|
name: "KJNodes.ConditioningMultiCombine",
|
|
async beforeRegisterNodeDef(nodeType, nodeData, app) {
|
|
switch (nodeData.name) {
|
|
case "ConditioningMultiCombine":
|
|
nodeType.prototype.onNodeMoved = function () {
|
|
console.log(this.pos[0])
|
|
}
|
|
nodeType.prototype.onNodeCreated = function () {
|
|
this.inputs_offset = nodeData.name.includes("selective")?1:0
|
|
this.cond_type = "CONDITIONING"
|
|
this.addWidget("button", "Add", null, () => {
|
|
if (!this.inputs) {
|
|
this.inputs = [];
|
|
}
|
|
if (this.inputs.length < 20) {
|
|
const newInputName = `conditioning_${this.inputs.length + 1}`;
|
|
this.addInput(newInputName, this.cond_type);
|
|
}
|
|
});
|
|
this.addWidget("button", "Remove", null, () => {
|
|
if (this.inputs.length > 2) {
|
|
const lastInputIndex = this.inputs.length - 1;
|
|
this.removeInput(lastInputIndex);
|
|
}
|
|
});
|
|
}
|
|
break;
|
|
}
|
|
},
|
|
}); |