From 9ef3c46855bdefff98752df614b5ba56eb2206a0 Mon Sep 17 00:00:00 2001 From: wolfden Date: Thu, 12 Nov 2026 23:06:28 -0600 Subject: [PATCH] Migrate deprecated legacy /scripts/ui.js imports to window.comfyAPI.ui ComfyUI's frontend build shims /scripts/ui.js and warns '[ComfyUI Deprecated] Importing from scripts/ui.js is deprecated'. Replace the deep relative import with the documented window.comfyAPI.ui surface in autocomplete.js, utils.js, lightbox.js and modelInfoDialog.js. No behavior change; \ and ComfyDialog are exported as const bindings in ui.ts and exposed on window.comfyAPI.ui. --- web/js/common/autocomplete.js | 3 ++- web/js/common/lightbox.js | 3 ++- web/js/common/modelInfoDialog.js | 3 ++- web/js/common/utils.js | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/web/js/common/autocomplete.js b/web/js/common/autocomplete.js index ecfea7b..e74e207 100644 --- a/web/js/common/autocomplete.js +++ b/web/js/common/autocomplete.js @@ -1,6 +1,7 @@ -import { $el } from "../../../../scripts/ui.js"; import { addStylesheet } from "./utils.js"; +const { $el } = window.comfyAPI.ui; + addStylesheet(import.meta.url); /* diff --git a/web/js/common/lightbox.js b/web/js/common/lightbox.js index 7e07445..66c1924 100644 --- a/web/js/common/lightbox.js +++ b/web/js/common/lightbox.js @@ -1,7 +1,8 @@ -import { $el } from "../../../../scripts/ui.js"; import { addStylesheet, getUrl, loadImage } from "./utils.js"; import { createSpinner } from "./spinner.js"; +const { $el } = window.comfyAPI.ui; + addStylesheet(getUrl("lightbox.css", import.meta.url)); const $$el = (tag, name, ...args) => { diff --git a/web/js/common/modelInfoDialog.js b/web/js/common/modelInfoDialog.js index d360aec..5b9822e 100644 --- a/web/js/common/modelInfoDialog.js +++ b/web/js/common/modelInfoDialog.js @@ -1,7 +1,8 @@ -import { $el, ComfyDialog } from "../../../../scripts/ui.js"; import { api } from "../../../../scripts/api.js"; import { addStylesheet } from "./utils.js"; +const { $el, ComfyDialog } = window.comfyAPI.ui; + addStylesheet(import.meta.url); class MetadataDialog extends ComfyDialog { diff --git a/web/js/common/utils.js b/web/js/common/utils.js index cd7539d..0f4b8e3 100644 --- a/web/js/common/utils.js +++ b/web/js/common/utils.js @@ -1,4 +1,4 @@ -import { $el } from "../../../../scripts/ui.js"; +const { $el } = window.comfyAPI.ui; export function addStylesheet(url) { if (url.endsWith(".js")) {