diff --git a/web/js/appearance.js b/web/js/appearance.js index d90b4aa..9069207 100644 --- a/web/js/appearance.js +++ b/web/js/appearance.js @@ -1,4 +1,4 @@ -import { app } from "../../../scripts/app.js"; +const { app } = window.comfyAPI.app; app.registerExtension({ name: "KJNodes.appearance", diff --git a/web/js/browserstatus.js b/web/js/browserstatus.js index 45abafb..7ef12a1 100644 --- a/web/js/browserstatus.js +++ b/web/js/browserstatus.js @@ -1,5 +1,5 @@ -import { api } from "../../../scripts/api.js"; -import { app } from "../../../scripts/app.js"; +const { api } = window.comfyAPI.api; +const { app } = window.comfyAPI.app; app.registerExtension({ name: "KJNodes.browserstatus", diff --git a/web/js/contextmenu.js b/web/js/contextmenu.js index 8485658..f189b30 100644 --- a/web/js/contextmenu.js +++ b/web/js/contextmenu.js @@ -1,4 +1,4 @@ -import { app } from "../../../scripts/app.js"; +const { app } = window.comfyAPI.app; // Adds context menu entries, code partly from pyssssscustom-scripts diff --git a/web/js/fast_preview.js b/web/js/fast_preview.js index 822c1f7..2717844 100644 --- a/web/js/fast_preview.js +++ b/web/js/fast_preview.js @@ -1,4 +1,4 @@ -import { app } from '../../../scripts/app.js' +const { app } = window.comfyAPI.app; //from melmass export function makeUUID() { diff --git a/web/js/help_popup.js b/web/js/help_popup.js index c4734be..9ea7135 100644 --- a/web/js/help_popup.js +++ b/web/js/help_popup.js @@ -1,4 +1,4 @@ -import { app } from "../../../scripts/app.js"; +const { app } = window.comfyAPI.app; // code based on mtb nodes by Mel Massadian https://github.com/melMass/comfy_mtb/ export const loadScript = ( diff --git a/web/js/jsnodes.js b/web/js/jsnodes.js index 2e67693..c391bd5 100644 --- a/web/js/jsnodes.js +++ b/web/js/jsnodes.js @@ -1,5 +1,5 @@ -import { app } from "../../../scripts/app.js"; -import { applyTextReplacements } from "../../../scripts/utils.js"; +const { app } = window.comfyAPI.app; +const { applyTextReplacements } = window.comfyAPI.utils; app.registerExtension({ name: "KJNodes.jsnodes", diff --git a/web/js/point_editor.js b/web/js/point_editor.js index 6baa108..b06ed75 100644 --- a/web/js/point_editor.js +++ b/web/js/point_editor.js @@ -1,4 +1,4 @@ -import { app } from '../../../scripts/app.js' +const { app } = window.comfyAPI.app; //from melmass export function makeUUID() { diff --git a/web/js/setgetnodes.js b/web/js/setgetnodes.js index 5c62f31..c193683 100644 --- a/web/js/setgetnodes.js +++ b/web/js/setgetnodes.js @@ -1,13 +1,15 @@ -import { app } from "../../../scripts/app.js"; +const { app } = window.comfyAPI.app; //based on diffus3's SetGet: https://github.com/diffus3/ComfyUI-extensions // Nodes that allow you to tunnel connections for cleaner graphs function setColorAndBgColor(type) { const colorMap = { + "DEFAULT": LGraphCanvas.node_colors.gray, "MODEL": LGraphCanvas.node_colors.blue, "LATENT": LGraphCanvas.node_colors.purple, "VAE": LGraphCanvas.node_colors.red, + "WANVAE": LGraphCanvas.node_colors.red, "CONDITIONING": LGraphCanvas.node_colors.brown, "IMAGE": LGraphCanvas.node_colors.pale_blue, "CLIP": LGraphCanvas.node_colors.yellow, @@ -21,12 +23,17 @@ function setColorAndBgColor(type) { "SIGMAS": { color: "#485248", bgcolor: "#272e27"}, }; - + console.log("Setting color for type:", colorMap[type]); const colors = colorMap[type]; if (colors) { this.color = colors.color; this.bgcolor = colors.bgcolor; } + else{ + // Default color + this.color = LGraphCanvas.node_colors.gray; + this.bgcolor = LGraphCanvas.node_colors.gray; + } } let disablePrefix = app.ui.settings.getSettingValue("KJNodes.disablePrefix") const LGraphNode = LiteGraph.LGraphNode diff --git a/web/js/spline_editor.js b/web/js/spline_editor.js index cc09599..3d358a2 100644 --- a/web/js/spline_editor.js +++ b/web/js/spline_editor.js @@ -1,4 +1,4 @@ -import { app } from '../../../scripts/app.js' +const { app } = window.comfyAPI.app; //from melmass export function makeUUID() {