mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-20 21:47:04 +08:00
Detect added nodes via search
This commit is contained in:
parent
aa26079727
commit
d2459b012a
@ -3,7 +3,6 @@
|
|||||||
import { api } from "./api.js";
|
import { api } from "./api.js";
|
||||||
import { clone } from "./utils.js";
|
import { clone } from "./utils.js";
|
||||||
|
|
||||||
|
|
||||||
export class ChangeTracker {
|
export class ChangeTracker {
|
||||||
static MAX_HISTORY = 50;
|
static MAX_HISTORY = 50;
|
||||||
#app;
|
#app;
|
||||||
@ -170,6 +169,17 @@ export class ChangeTracker {
|
|||||||
return v;
|
return v;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Detects nodes being added via the node search dialog
|
||||||
|
const onNodeAdded = LiteGraph.LGraph.prototype.onNodeAdded;
|
||||||
|
LiteGraph.LGraph.prototype.onNodeAdded = function () {
|
||||||
|
const v = onNodeAdded?.apply(this, arguments);
|
||||||
|
const ct = changeTracker();
|
||||||
|
if (!ct.isOurLoad) {
|
||||||
|
ct.checkState();
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
};
|
||||||
|
|
||||||
// Store node outputs
|
// Store node outputs
|
||||||
api.addEventListener("executed", ({ detail }) => {
|
api.addEventListener("executed", ({ detail }) => {
|
||||||
const prompt = app.workflowManager.queuedPrompts[detail.prompt_id];
|
const prompt = app.workflowManager.queuedPrompts[detail.prompt_id];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user