In API json export, add groupTitle to nodes that come from a group

This commit is contained in:
Narciso Jaramillo 2024-06-22 15:02:02 -07:00
parent 887a6341ed
commit 59805f290b
2 changed files with 4 additions and 0 deletions

View File

@ -1188,6 +1188,8 @@ export class GroupNodeHandler {
await config.registerType();
const groupNode = LiteGraph.createNode(`workflow/${name}`);
groupNode.title = name;
// Reuse the existing nodes for this instance
groupNode.setInnerNodes(builder.nodes);
groupNode[GROUP].populateWidgets();

View File

@ -1960,6 +1960,7 @@ export class ComfyApp {
for (const outerNode of this.graph.computeExecutionOrder(false)) {
const skipNode = outerNode.mode === 2 || outerNode.mode === 4;
const innerNodes = (!skipNode && outerNode.getInnerNodes) ? outerNode.getInnerNodes() : [outerNode];
const groupTitle = outerNode.getInnerNodes ? outerNode.title : undefined;
for (const node of innerNodes) {
if (node.isVirtualNode) {
continue;
@ -2041,6 +2042,7 @@ export class ComfyApp {
// Ignored by the backend.
node_data["_meta"] = {
title: node.title,
groupTitle
}
}