|
|
@ -7,11 +7,25 @@ import { ComfyDialog, $el } from "../../scripts/ui.js"; |
|
|
|
let pack_map = {}; |
|
|
|
let pack_map = {}; |
|
|
|
let rpack_map = {}; |
|
|
|
let rpack_map = {}; |
|
|
|
|
|
|
|
|
|
|
|
function getPureName(node) { |
|
|
|
export function getPureName(node) { |
|
|
|
// group nodes/
|
|
|
|
// group nodes/
|
|
|
|
let category = node.category.substring(12); |
|
|
|
let category = null; |
|
|
|
|
|
|
|
if(node.category) { |
|
|
|
|
|
|
|
category = node.category.substring(12); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
category = node.constructor.category?.substring(12); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(category) { |
|
|
|
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/')) { |
|
|
|
|
|
|
|
return node.comfyClass.substring(9); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
return node.comfyClass; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isValidVersionString(version) { |
|
|
|
function isValidVersionString(version) { |
|
|
@ -72,6 +86,7 @@ export async function load_components() { |
|
|
|
await config.registerType(category); |
|
|
|
await config.registerType(category); |
|
|
|
|
|
|
|
|
|
|
|
register_pack_map(name, data); |
|
|
|
register_pack_map(name, data); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
@ -81,8 +96,8 @@ export async function load_components() { |
|
|
|
storeGroupNode(name, nodeData); |
|
|
|
storeGroupNode(name, nodeData); |
|
|
|
|
|
|
|
|
|
|
|
const config = new GroupNodeConfig(name, nodeData); |
|
|
|
const config = new GroupNodeConfig(name, nodeData); |
|
|
|
while(!success) { |
|
|
|
|
|
|
|
var success = false; |
|
|
|
while(true) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
let category = nodeData.packname; |
|
|
|
let category = nodeData.packname; |
|
|
|
if(nodeData.category) { |
|
|
|
if(nodeData.category) { |
|
|
@ -94,12 +109,13 @@ export async function load_components() { |
|
|
|
|
|
|
|
|
|
|
|
await config.registerType(category); |
|
|
|
await config.registerType(category); |
|
|
|
register_pack_map(name, nodeData); |
|
|
|
register_pack_map(name, nodeData); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
catch { |
|
|
|
catch { |
|
|
|
let elapsed_time = Date.now() - start_time; |
|
|
|
let elapsed_time = Date.now() - start_time; |
|
|
|
if (elapsed_time > 5000) { |
|
|
|
if (elapsed_time > 5000) { |
|
|
|
failed.push(name); |
|
|
|
failed.push(name); |
|
|
|
success = true; |
|
|
|
break; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
await sleep(100); |
|
|
|
await sleep(100); |
|
|
|
} |
|
|
|
} |
|
|
@ -120,8 +136,7 @@ export async function load_components() { |
|
|
|
storeGroupNode(name, nodeData); |
|
|
|
storeGroupNode(name, nodeData); |
|
|
|
|
|
|
|
|
|
|
|
const config = new GroupNodeConfig(name, nodeData); |
|
|
|
const config = new GroupNodeConfig(name, nodeData); |
|
|
|
while(!success) { |
|
|
|
while(true) { |
|
|
|
var success = false; |
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
let category = nodeData.packname; |
|
|
|
let category = nodeData.packname; |
|
|
|
if(nodeData.workflow.category) { |
|
|
|
if(nodeData.workflow.category) { |
|
|
@ -133,12 +148,13 @@ export async function load_components() { |
|
|
|
|
|
|
|
|
|
|
|
await config.registerType(category); |
|
|
|
await config.registerType(category); |
|
|
|
register_pack_map(name, nodeData); |
|
|
|
register_pack_map(name, nodeData); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
catch { |
|
|
|
catch { |
|
|
|
let elapsed_time = Date.now() - start_time; |
|
|
|
let elapsed_time = Date.now() - start_time; |
|
|
|
if (elapsed_time > 10000) { |
|
|
|
if (elapsed_time > 10000) { |
|
|
|
failed2.push(name); |
|
|
|
failed2.push(name); |
|
|
|
success = true; |
|
|
|
break; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
await sleep(100); |
|
|
|
await sleep(100); |
|
|
|
} |
|
|
|
} |
|
|
@ -155,9 +171,7 @@ export async function load_components() { |
|
|
|
storeGroupNode(name, nodeData); |
|
|
|
storeGroupNode(name, nodeData); |
|
|
|
|
|
|
|
|
|
|
|
const config = new GroupNodeConfig(name, nodeData); |
|
|
|
const config = new GroupNodeConfig(name, nodeData); |
|
|
|
while(!success) { |
|
|
|
while(true) { |
|
|
|
var success = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
let category = nodeData.workflow.packname; |
|
|
|
let category = nodeData.workflow.packname; |
|
|
|
if(nodeData.workflow.category) { |
|
|
|
if(nodeData.workflow.category) { |
|
|
@ -169,12 +183,13 @@ export async function load_components() { |
|
|
|
|
|
|
|
|
|
|
|
await config.registerType(category); |
|
|
|
await config.registerType(category); |
|
|
|
register_pack_map(name, nodeData); |
|
|
|
register_pack_map(name, nodeData); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
catch { |
|
|
|
catch { |
|
|
|
let elapsed_time = Date.now() - start_time; |
|
|
|
let elapsed_time = Date.now() - start_time; |
|
|
|
if (elapsed_time > 30000) { |
|
|
|
if (elapsed_time > 30000) { |
|
|
|
failed.push(name); |
|
|
|
failed.push(name); |
|
|
|
success = true; |
|
|
|
break; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
await sleep(100); |
|
|
|
await sleep(100); |
|
|
|
} |
|
|
|
} |
|
|
@ -708,12 +723,11 @@ function getChangedVersion(groupNodes) { |
|
|
|
|
|
|
|
|
|
|
|
const loadGraphData = app.loadGraphData; |
|
|
|
const loadGraphData = app.loadGraphData; |
|
|
|
app.loadGraphData = async function () { |
|
|
|
app.loadGraphData = async function () { |
|
|
|
const v = await loadGraphData.apply(this, arguments); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(arguments.length == 0) |
|
|
|
if(arguments.length == 0) |
|
|
|
return v; |
|
|
|
return await loadGraphData.apply(this, arguments); |
|
|
|
|
|
|
|
|
|
|
|
let groupNodes = arguments[0].extra?.groupNodes; |
|
|
|
let graphData = arguments[0]; |
|
|
|
|
|
|
|
let groupNodes = graphData.extra?.groupNodes; |
|
|
|
let res = getChangedVersion(groupNodes); |
|
|
|
let res = getChangedVersion(groupNodes); |
|
|
|
|
|
|
|
|
|
|
|
if(res) { |
|
|
|
if(res) { |
|
|
@ -734,7 +748,10 @@ app.loadGraphData = async function () { |
|
|
|
if(target_components) { |
|
|
|
if(target_components) { |
|
|
|
for(let i in target_components) { |
|
|
|
for(let i in target_components) { |
|
|
|
let component_name = target_components[i]; |
|
|
|
let component_name = target_components[i]; |
|
|
|
restore_to_loaded_component(component_name); |
|
|
|
let component = rpack_map[component_name]; |
|
|
|
|
|
|
|
if(component && graphData.extra?.groupNodes) { |
|
|
|
|
|
|
|
graphData.extra.groupNodes[component_name] = component; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -742,7 +759,8 @@ app.loadGraphData = async function () { |
|
|
|
console.log('Empty components: policy ignored'); |
|
|
|
console.log('Empty components: policy ignored'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return v; |
|
|
|
arguments[0] = graphData; |
|
|
|
|
|
|
|
return await loadGraphData.apply(this, arguments); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export function set_component_policy(v) { |
|
|
|
export function set_component_policy(v) { |
|
|
|