From 5ddbfdf44bdf56da60fd5f8c4ddf910b3addf90c Mon Sep 17 00:00:00 2001 From: bennykok Date: Thu, 8 Feb 2024 22:54:37 +0800 Subject: [PATCH] feat(plugin): update comfyui json version, add missing nodes display --- web-plugin/index.js | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/web-plugin/index.js b/web-plugin/index.js index cadbc38..4f0503b 100644 --- a/web-plugin/index.js +++ b/web-plugin/index.js @@ -1,7 +1,7 @@ import { app } from "./app.js"; import { api } from "./api.js"; import { ComfyWidgets, LGraphNode } from "./widgets.js"; -import { generateDependencyGraph } from "https://esm.sh/comfyui-json@0.1.9"; +import { generateDependencyGraph } from "https://esm.sh/comfyui-json@0.1.14"; /** @typedef {import('../../../web/types/comfy.js').ComfyExtension} ComfyExtension*/ /** @type {ComfyExtension} */ @@ -184,12 +184,28 @@ function createDynamicUIHtml(data) { let html = '
'; const bgcolor = "var(--comfy-input-bg)"; + const evenBg = "var(--border-color)"; const textColor = "var(--input-text)"; // Custom Nodes html += `
`; html += '

Custom Nodes

'; + + if (data.missing_nodes?.length > 0) { + html += ` +
+

Missing Nodes

+

These nodes are not found with any matching custom_nodes in the ComfyUI Manager Database

+ ${data.missing_nodes + .map((node) => { + return `

${node}

`; + }) + .join("")} +
+ `; + } + Object.values(data.custom_nodes).forEach((node) => { html += `
@@ -346,10 +362,10 @@ function addButton() { "Generating dependency graph", "Please wait...", ); - deps = await generateDependencyGraph( - prompt.output, - snapshot, - async (file) => { + deps = await generateDependencyGraph({ + workflow_api: prompt.output, + snapshot: snapshot, + computeFileHash: async (file) => { console.log(file); loadingDialog.showLoading("Generating hash", file); const hash = await fetch( @@ -361,7 +377,7 @@ function addButton() { console.log(hash); return hash.file_hash; }, - async (file, hash, prevhash) => { + handleFileUpload: async (file, hash, prevhash) => { console.log("Uploading ", file); loadingDialog.showLoading("Uploading file", file); try { @@ -388,8 +404,8 @@ function addButton() { return undefined; } }, - existing_workflow.dependencies, - ); + existingDependencies: existing_workflow.dependencies, + }); loadingDialog.close();