Remove stale ref_images input from saved nodes
This commit is contained in:
@@ -11542,6 +11542,15 @@ app.registerExtension({
|
||||
const fallbackWidget = node.widgets[fallbackIndex];
|
||||
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 = {}) {
|
||||
const originNode = self._findLinkedOriginNode(targetNode, inputName);
|
||||
if (!originNode) return null;
|
||||
@@ -11770,6 +11779,7 @@ app.registerExtension({
|
||||
}
|
||||
}
|
||||
};
|
||||
this._removeLegacyInputs();
|
||||
|
||||
const origOnConnectionsChange = this.onConnectionsChange;
|
||||
this.onConnectionsChange = function (type, index, connected, link_info) {
|
||||
@@ -12179,6 +12189,7 @@ app.registerExtension({
|
||||
nodeType.prototype.onConfigure = function (info) {
|
||||
// 1. Call parent/original onConfigure first, with info.widgets_values intact
|
||||
const out = onConfigure ? onConfigure.apply(this, arguments) : undefined;
|
||||
this._removeLegacyInputs?.();
|
||||
|
||||
if (info.properties) {
|
||||
this.properties = { ...this.properties, ...info.properties };
|
||||
|
||||
Reference in New Issue
Block a user