Remove stale ref_images input from saved nodes
This commit is contained in:
@@ -11542,6 +11542,15 @@ app.registerExtension({
|
|||||||
const fallbackWidget = node.widgets[fallbackIndex];
|
const fallbackWidget = node.widgets[fallbackIndex];
|
||||||
return fallbackWidget?.value ?? null;
|
return fallbackWidget?.value ?? null;
|
||||||
};
|
};
|
||||||
|
this._removeLegacyInputs = function () {
|
||||||
|
if (!Array.isArray(self.inputs)) return;
|
||||||
|
for (const legacyName of ["ref_images"]) {
|
||||||
|
const idx = self.inputs.findIndex(i => i?.name === legacyName);
|
||||||
|
if (idx !== -1) {
|
||||||
|
self.removeInput(idx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
this._resolveNodeLinkedValue = function (targetNode, inputName, options = {}) {
|
this._resolveNodeLinkedValue = function (targetNode, inputName, options = {}) {
|
||||||
const originNode = self._findLinkedOriginNode(targetNode, inputName);
|
const originNode = self._findLinkedOriginNode(targetNode, inputName);
|
||||||
if (!originNode) return null;
|
if (!originNode) return null;
|
||||||
@@ -11770,6 +11779,7 @@ app.registerExtension({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
this._removeLegacyInputs();
|
||||||
|
|
||||||
const origOnConnectionsChange = this.onConnectionsChange;
|
const origOnConnectionsChange = this.onConnectionsChange;
|
||||||
this.onConnectionsChange = function (type, index, connected, link_info) {
|
this.onConnectionsChange = function (type, index, connected, link_info) {
|
||||||
@@ -12176,13 +12186,14 @@ app.registerExtension({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onConfigure = nodeType.prototype.onConfigure;
|
const onConfigure = nodeType.prototype.onConfigure;
|
||||||
nodeType.prototype.onConfigure = function (info) {
|
nodeType.prototype.onConfigure = function (info) {
|
||||||
// 1. Call parent/original onConfigure first, with info.widgets_values intact
|
// 1. Call parent/original onConfigure first, with info.widgets_values intact
|
||||||
const out = onConfigure ? onConfigure.apply(this, arguments) : undefined;
|
const out = onConfigure ? onConfigure.apply(this, arguments) : undefined;
|
||||||
|
this._removeLegacyInputs?.();
|
||||||
if (info.properties) {
|
|
||||||
this.properties = { ...this.properties, ...info.properties };
|
if (info.properties) {
|
||||||
}
|
this.properties = { ...this.properties, ...info.properties };
|
||||||
|
}
|
||||||
|
|
||||||
console.log("[LTXDirector debug] onConfigure called. info.widgets_values:", info.widgets_values ? JSON.stringify(info.widgets_values) : "undefined");
|
console.log("[LTXDirector debug] onConfigure called. info.widgets_values:", info.widgets_values ? JSON.stringify(info.widgets_values) : "undefined");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user