mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-19 00:07:04 +08:00
Unbreak things
This commit is contained in:
parent
180730c134
commit
92317abd1a
@ -206,11 +206,14 @@ app.registerExtension({
|
|||||||
this.widgets?.sort((a, b) => (a.primitiveSlot || 0) - (a.primitiveSlot || 0));
|
this.widgets?.sort((a, b) => (a.primitiveSlot || 0) - (a.primitiveSlot || 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
applyToGraph(slot) {
|
applyToGraph() {
|
||||||
if (!this.outputs[slot].links?.length) return;
|
for (const o of this.outputs) {
|
||||||
|
if (!o.links?.length) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// For each output link copy our value over the original widget value
|
// For each output link copy our value over the original widget value
|
||||||
for (const l of this.outputs[slot].links) {
|
for (const l of o.links) {
|
||||||
const linkInfo = app.graph.links[l];
|
const linkInfo = app.graph.links[l];
|
||||||
const node = this.graph.getNodeById(linkInfo.target_id);
|
const node = this.graph.getNodeById(linkInfo.target_id);
|
||||||
const input = node.inputs[linkInfo.target_slot];
|
const input = node.inputs[linkInfo.target_slot];
|
||||||
@ -218,7 +221,7 @@ app.registerExtension({
|
|||||||
if (widgetName) {
|
if (widgetName) {
|
||||||
const widget = node.widgets.find((w) => w.name === widgetName);
|
const widget = node.widgets.find((w) => w.name === widgetName);
|
||||||
if (widget) {
|
if (widget) {
|
||||||
widget.value = this.widgets[slot].value;
|
widget.value = this.widgets[linkInfo.origin_slot].value;
|
||||||
if (widget.callback) {
|
if (widget.callback) {
|
||||||
widget.callback(widget.value, app.canvas, node, app.canvas.graph_mouse, {});
|
widget.callback(widget.value, app.canvas, node, app.canvas.graph_mouse, {});
|
||||||
}
|
}
|
||||||
@ -226,6 +229,7 @@ app.registerExtension({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onConnectionsChange(_, index, connected, linkInfo) {
|
onConnectionsChange(_, index, connected, linkInfo) {
|
||||||
let slot = linkInfo.origin_slot;
|
let slot = linkInfo.origin_slot;
|
||||||
@ -318,7 +322,7 @@ app.registerExtension({
|
|||||||
const self = this;
|
const self = this;
|
||||||
widget.callback = function () {
|
widget.callback = function () {
|
||||||
const r = callback ? callback.apply(this, arguments) : undefined;
|
const r = callback ? callback.apply(this, arguments) : undefined;
|
||||||
self.applyToGraph(slot);
|
self.applyToGraph();
|
||||||
return r;
|
return r;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user