mirror of
https://git.datalinker.icu/ltdrdata/ComfyUI-Manager
synced 2025-12-09 14:14:54 +08:00
Update groupnode/component to be compatible with frontend v1.2.64 (#1084)
This commit is contained in:
parent
f3e9856107
commit
32430968b8
@ -1135,7 +1135,7 @@ async def extract_nodes_from_workflow(filepath, mode='local', channel_url='defau
|
|||||||
if node_name in ['Reroute', 'Note']:
|
if node_name in ['Reroute', 'Note']:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if node_name is not None and not node_name.startswith('workflow/'):
|
if node_name is not None and not (node_name.startswith('workflow/') or node_name.startswith('workflow>')):
|
||||||
used_nodes.add(node_name)
|
used_nodes.add(node_name)
|
||||||
|
|
||||||
if 'nodes' in workflow:
|
if 'nodes' in workflow:
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import { sleep, show_message } from "./common.js";
|
|||||||
import { GroupNodeConfig, GroupNodeHandler } from "../../extensions/core/groupNode.js";
|
import { GroupNodeConfig, GroupNodeHandler } from "../../extensions/core/groupNode.js";
|
||||||
import { ComfyDialog, $el } from "../../scripts/ui.js";
|
import { ComfyDialog, $el } from "../../scripts/ui.js";
|
||||||
|
|
||||||
|
const SEPARATOR = ">"
|
||||||
|
|
||||||
let pack_map = {};
|
let pack_map = {};
|
||||||
let rpack_map = {};
|
let rpack_map = {};
|
||||||
|
|
||||||
@ -20,7 +22,7 @@ export function getPureName(node) {
|
|||||||
let purename = node.comfyClass.substring(category.length+1);
|
let purename = node.comfyClass.substring(category.length+1);
|
||||||
return purename;
|
return purename;
|
||||||
}
|
}
|
||||||
else if(node.comfyClass.startsWith('workflow/')) {
|
else if(node.comfyClass.startsWith('workflow/') || node.comfyClass.startsWith(`workflow${SEPARATOR}`)) {
|
||||||
return node.comfyClass.substring(9);
|
return node.comfyClass.substring(9);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -76,7 +78,7 @@ export async function load_components() {
|
|||||||
|
|
||||||
let category = data.packname;
|
let category = data.packname;
|
||||||
if(data.category) {
|
if(data.category) {
|
||||||
category += "/" + data.category;
|
category += SEPARATOR + data.category;
|
||||||
}
|
}
|
||||||
if(category == '') {
|
if(category == '') {
|
||||||
category = 'components';
|
category = 'components';
|
||||||
@ -100,7 +102,7 @@ export async function load_components() {
|
|||||||
try {
|
try {
|
||||||
let category = nodeData.packname;
|
let category = nodeData.packname;
|
||||||
if(nodeData.category) {
|
if(nodeData.category) {
|
||||||
category += "/" + nodeData.category;
|
category += SEPARATOR + nodeData.category;
|
||||||
}
|
}
|
||||||
if(category == '') {
|
if(category == '') {
|
||||||
category = 'components';
|
category = 'components';
|
||||||
@ -139,7 +141,7 @@ export async function load_components() {
|
|||||||
try {
|
try {
|
||||||
let category = nodeData.packname;
|
let category = nodeData.packname;
|
||||||
if(nodeData.workflow.category) {
|
if(nodeData.workflow.category) {
|
||||||
category += "/" + nodeData.category;
|
category += SEPARATOR + nodeData.category;
|
||||||
}
|
}
|
||||||
if(category == '') {
|
if(category == '') {
|
||||||
category = 'components';
|
category = 'components';
|
||||||
@ -174,7 +176,7 @@ export async function load_components() {
|
|||||||
try {
|
try {
|
||||||
let category = nodeData.workflow.packname;
|
let category = nodeData.workflow.packname;
|
||||||
if(nodeData.workflow.category) {
|
if(nodeData.workflow.category) {
|
||||||
category += "/" + nodeData.category;
|
category += SEPARATOR + nodeData.category;
|
||||||
}
|
}
|
||||||
if(category == '') {
|
if(category == '') {
|
||||||
category = 'components';
|
category = 'components';
|
||||||
@ -234,7 +236,7 @@ async function save_as_component(node, version, author, prefix, nodename, packna
|
|||||||
|
|
||||||
let category = body.workflow.packname;
|
let category = body.workflow.packname;
|
||||||
if(body.workflow.category) {
|
if(body.workflow.category) {
|
||||||
category += "/" + body.workflow.category;
|
category += SEPARATOR + body.workflow.category;
|
||||||
}
|
}
|
||||||
if(category == '') {
|
if(category == '') {
|
||||||
category = 'components';
|
category = 'components';
|
||||||
@ -266,7 +268,7 @@ async function import_component(component_name, component, mode) {
|
|||||||
|
|
||||||
let category = component.packname;
|
let category = component.packname;
|
||||||
if(component.category) {
|
if(component.category) {
|
||||||
category += "/" + component.category;
|
category += SEPARATOR + component.category;
|
||||||
}
|
}
|
||||||
if(category == '') {
|
if(category == '') {
|
||||||
category = 'components';
|
category = 'components';
|
||||||
@ -403,7 +405,7 @@ function handle_import_components(components) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(cnt == 1 && last_name) {
|
if(cnt == 1 && last_name) {
|
||||||
const node = LiteGraph.createNode(`workflow/${last_name}`);
|
const node = LiteGraph.createNode(`workflow${SEPARATOR}${last_name}`);
|
||||||
node.pos = [app.canvas.graph_mouse[0], app.canvas.graph_mouse[1]];
|
node.pos = [app.canvas.graph_mouse[0], app.canvas.graph_mouse[1]];
|
||||||
app.canvas.graph.add(node, false);
|
app.canvas.graph.add(node, false);
|
||||||
}
|
}
|
||||||
@ -786,7 +788,7 @@ app.graphToPrompt = async function () {
|
|||||||
// get used group nodes
|
// get used group nodes
|
||||||
let used_group_nodes = new Set();
|
let used_group_nodes = new Set();
|
||||||
for(let node of p.workflow.nodes) {
|
for(let node of p.workflow.nodes) {
|
||||||
if(node.type.startsWith('workflow/')) {
|
if(node.type.startsWith(`workflow/`) || node.type.startsWith(`workflow${SEPARATOR}`)) {
|
||||||
used_group_nodes.add(node.type.substring(9));
|
used_group_nodes.add(node.type.substring(9));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1106,7 +1106,7 @@ export class CustomNodesManager {
|
|||||||
|
|
||||||
for (let i in nodes) {
|
for (let i in nodes) {
|
||||||
const node_type = nodes[i].type;
|
const node_type = nodes[i].type;
|
||||||
if(node_type.startsWith('workflow/'))
|
if(node_type.startsWith('workflow/') || node_type.startsWith('workflow>'))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!registered_nodes.has(node_type)) {
|
if (!registered_nodes.has(node_type)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user