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.
This commit is contained in:
wolfden
2026-11-12 23:06:28 -06:00
parent 86c9bddb20
commit 9ef3c46855
4 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import { $el } from "../../../../scripts/ui.js";
import { addStylesheet } from "./utils.js";
const { $el } = window.comfyAPI.ui;
addStylesheet(import.meta.url);
/*
+2 -1
View File
@@ -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) => {
+2 -1
View File
@@ -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 {
+1 -1
View File
@@ -1,4 +1,4 @@
import { $el } from "../../../../scripts/ui.js";
const { $el } = window.comfyAPI.ui;
export function addStylesheet(url) {
if (url.endsWith(".js")) {