From 4f90ba34737cbc07082fcd20fe2c4c87df2bbe8b Mon Sep 17 00:00:00 2001 From: RyanOnTheInside <7623207+ryanontheinside@users.noreply.github.com> Date: Sun, 15 Feb 2026 10:27:31 -0500 Subject: [PATCH] fix: comfyui-manager lower case bug --- js/ui/styles/index.js | 16 +++++++++++++--- pyproject.toml | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/js/ui/styles/index.js b/js/ui/styles/index.js index 8b4ed19..b250530 100644 --- a/js/ui/styles/index.js +++ b/js/ui/styles/index.js @@ -1,9 +1,19 @@ +// Derive the extension name from the URL this script was loaded from, +// so it works whether the folder is "ComfyUI_ControlFreak" or "comfyui_controlfreak". +const _extensionName = (() => { + try { + const url = import.meta.url; + const match = url.match(/\/extensions\/([^/]+)\//); + if (match) return match[1]; + } catch (e) {} + return 'comfyui_controlfreak'; +})(); + function loadCssWithComfyApi(relativePath) { try { if (window.comfyAPI?.utils?.addStylesheet) { - const cssUrlPath = `/extensions/ComfyUI_ControlFreak/ui/styles/${relativePath}`; + const cssUrlPath = `/extensions/${_extensionName}/ui/styles/${relativePath}`; window.comfyAPI.utils.addStylesheet(cssUrlPath); - // console.log(`ControlFreak: Requested loading CSS ${cssUrlPath} via ComfyAPI`); } else { console.warn(`ControlFreak: comfyAPI.utils.addStylesheet not found. Cannot load ${relativePath} dynamically.`); } @@ -21,4 +31,4 @@ loadCssWithComfyApi('mappingComponent.css'); loadCssWithComfyApi('controllerButton.css'); loadCssWithComfyApi('theme.css'); loadCssWithComfyApi('branding.css'); -loadCssWithComfyApi('nodeStyles.css'); \ No newline at end of file +loadCssWithComfyApi('nodeStyles.css'); diff --git a/pyproject.toml b/pyproject.toml index 5c82da4..9130239 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui_controlfreak" description = "Map MIDI controllers, gamepads, and other devices to ComfyUI parameters" -version = "0.0.1" +version = "0.0.2" license = {file = "LICENSE"} dependencies = []