support missing node installer for ComfyUI-Workflow-Component

This commit is contained in:
Dr.Lt.Data 2023-06-04 20:32:39 +09:00
parent ea08191fa8
commit 74c3f81094
2 changed files with 25 additions and 1 deletions

View File

@ -16,7 +16,7 @@ sys.path.append('../..')
from torchvision.datasets.utils import download_url
# ensure .js
print("### Loading: ComfyUI-Manager (V0.7.2)")
print("### Loading: ComfyUI-Manager (V0.8)")
comfy_path = os.path.dirname(folder_paths.__file__)
custom_nodes_path = os.path.join(comfy_path, 'custom_nodes')

View File

@ -16,6 +16,22 @@ async function getCustomnodeMappings() {
return data;
}
async function getUnresolvedNodesInComponent() {
try {
var mode = "url";
if(ManagerMenuDialog.instance.local_mode_checkbox.checked)
mode = "local";
const response = await fetch(`/component/get_unresolved`);
const data = await response.json();
return data.nodes;
}
catch {
return [];
}
}
async function getCustomNodes() {
var mode = "url";
if(ManagerMenuDialog.instance.local_mode_checkbox.checked)
@ -243,6 +259,14 @@ class CustomNodesInstaller extends ComfyDialog {
}
}
let unresolved_nodes = await getUnresolvedNodesInComponent();
for (let i in unresolved_nodes) {
let node_type = unresolved_nodes[i];
const url = name_to_url[node_type];
if(url)
missing_nodes.add(url);
}
return data.filter(node => node.files.some(file => missing_nodes.has(file)));
}