fix: comfyui-manager lower case bug

This commit is contained in:
RyanOnTheInside
2026-02-15 10:27:59 -05:00
parent 9513dcdb8e
commit 4f90ba3473
2 changed files with 14 additions and 4 deletions
+13 -3
View File
@@ -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');
loadCssWithComfyApi('nodeStyles.css');
+1 -1
View File
@@ -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 = []