Fix: set output label alongside name for LiteGraph rendering

This commit is contained in:
2026-03-01 00:06:19 +01:00
parent 64736c03ab
commit c5901bb438

View File

@@ -87,7 +87,7 @@ app.registerExtension({
delete oldSlots[key];
} else {
// New key — create a fresh slot
newOutputs.push({ name: key, type: type, links: null });
newOutputs.push({ name: key, label: key, type: type, links: null });
}
}
@@ -189,6 +189,7 @@ app.registerExtension({
if (keys.length > 0) {
for (let i = 0; i < this.outputs.length && i < keys.length; i++) {
this.outputs[i].name = keys[i].trim();
this.outputs[i].label = keys[i].trim();
if (types[i]) this.outputs[i].type = types[i];
}
while (this.outputs.length > keys.length) {
@@ -205,10 +206,10 @@ app.registerExtension({
}
// === DIAGNOSTIC (remove after debugging) ===
console.log("[JDL-DEBUG] this.outputs AFTER RENAME:", JSON.stringify(this.outputs?.map(o => ({name: o.name, type: o.type}))));
console.log("[JDL-DEBUG] this.outputs AFTER RENAME:", JSON.stringify(this.outputs?.map(o => ({name: o.name, label: o.label, type: o.type}))));
const _node = this;
setTimeout(() => {
console.log("[JDL-DEBUG] this.outputs 1s LATER:", JSON.stringify(_node.outputs?.map(o => ({name: o.name, type: o.type}))));
console.log("[JDL-DEBUG] this.outputs 1s LATER:", JSON.stringify(_node.outputs?.map(o => ({name: o.name, label: o.label, type: o.type}))));
}, 1000);
// === END DIAGNOSTIC ===