fix: comfyui-manager lower case bug
This commit is contained in:
+13
-3
@@ -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
@@ -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 = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user