mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 22:52:12 -03:00
feat(graph): enhance node handling with graph identifiers and improve metadata updates, see #408, #538
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { app } from "../../scripts/app.js";
|
||||
import { api } from "../../scripts/api.js";
|
||||
import { addJsonDisplayWidget } from "./json_display_widget.js";
|
||||
import { getNodeFromGraph } from "./utils.js";
|
||||
|
||||
app.registerExtension({
|
||||
name: "LoraManager.DebugMetadata",
|
||||
@@ -8,8 +9,8 @@ app.registerExtension({
|
||||
setup() {
|
||||
// Add message handler to listen for metadata updates from Python
|
||||
api.addEventListener("metadata_update", (event) => {
|
||||
const { id, metadata } = event.detail;
|
||||
this.handleMetadataUpdate(id, metadata);
|
||||
const { id, graph_id: graphId, metadata } = event.detail;
|
||||
this.handleMetadataUpdate(id, graphId, metadata);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -37,8 +38,8 @@ app.registerExtension({
|
||||
},
|
||||
|
||||
// Handle metadata updates from Python
|
||||
handleMetadataUpdate(id, metadata) {
|
||||
const node = app.graph.getNodeById(+id);
|
||||
handleMetadataUpdate(id, graphId, metadata) {
|
||||
const node = getNodeFromGraph(graphId, id);
|
||||
if (!node || node.comfyClass !== "Debug Metadata (LoraManager)") {
|
||||
console.warn("Node not found or not a DebugMetadata node:", id);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user