mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-17 10:22:59 +08:00
Merge branch 'main' into feat/cnr
This commit is contained in:
commit
2c3a11012f
@ -202,6 +202,40 @@ docStyle.innerHTML = `
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
function is_legacy_front() {
|
||||||
|
let compareVersion = '1.2.49';
|
||||||
|
try {
|
||||||
|
const frontendVersion = window['__COMFYUI_FRONTEND_VERSION__'];
|
||||||
|
if (typeof frontendVersion !== 'string') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseVersion(versionString) {
|
||||||
|
const parts = versionString.split('.').map(Number);
|
||||||
|
return parts.length === 3 && parts.every(part => !isNaN(part)) ? parts : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const currentVersion = parseVersion(frontendVersion);
|
||||||
|
const comparisonVersion = parseVersion(compareVersion);
|
||||||
|
|
||||||
|
if (!currentVersion || !comparisonVersion) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < 3; i++) {
|
||||||
|
if (currentVersion[i] > comparisonVersion[i]) {
|
||||||
|
return false;
|
||||||
|
} else if (currentVersion[i] < comparisonVersion[i]) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
} catch {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
document.head.appendChild(docStyle);
|
document.head.appendChild(docStyle);
|
||||||
|
|
||||||
var update_comfyui_button = null;
|
var update_comfyui_button = null;
|
||||||
@ -1034,7 +1068,9 @@ class ManagerMenuDialog extends ComfyDialog {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// nickname
|
// nickname
|
||||||
let badge_combo = document.createElement("select");
|
let badge_combo = "";
|
||||||
|
if(is_legacy_front()) {
|
||||||
|
badge_combo = document.createElement("select");
|
||||||
badge_combo.setAttribute("title", "Configure the content to be displayed on the badge at the top right corner of the node. The ID is the identifier of the node. If 'hide built-in' is selected, both unknown nodes and built-in nodes will be omitted, making them indistinguishable");
|
badge_combo.setAttribute("title", "Configure the content to be displayed on the badge at the top right corner of the node. The ID is the identifier of the node. If 'hide built-in' is selected, both unknown nodes and built-in nodes will be omitted, making them indistinguishable");
|
||||||
badge_combo.className = "cm-menu-combo";
|
badge_combo.className = "cm-menu-combo";
|
||||||
badge_combo.appendChild($el('option', { value: 'none', text: 'Badge: None' }, []));
|
badge_combo.appendChild($el('option', { value: 'none', text: 'Badge: None' }, []));
|
||||||
@ -1052,6 +1088,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
|||||||
badge_mode = event.target.value;
|
badge_mode = event.target.value;
|
||||||
app.graph.setDirtyCanvas(true);
|
app.graph.setDirtyCanvas(true);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// channel
|
// channel
|
||||||
let channel_combo = document.createElement("select");
|
let channel_combo = document.createElement("select");
|
||||||
@ -1615,6 +1652,7 @@ app.registerExtension({
|
|||||||
},
|
},
|
||||||
|
|
||||||
async nodeCreated(node, app) {
|
async nodeCreated(node, app) {
|
||||||
|
if(is_legacy_front()) {
|
||||||
if(!node.badge_enabled) {
|
if(!node.badge_enabled) {
|
||||||
node.getNickname = function () { return getNickname(node, node.comfyClass.trim()) };
|
node.getNickname = function () { return getNickname(node, node.comfyClass.trim()) };
|
||||||
let orig = node.onDrawForeground;
|
let orig = node.onDrawForeground;
|
||||||
@ -1626,14 +1664,17 @@ app.registerExtension({
|
|||||||
};
|
};
|
||||||
node.badge_enabled = true;
|
node.badge_enabled = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async loadedGraphNode(node, app) {
|
async loadedGraphNode(node, app) {
|
||||||
|
if(is_legacy_front()) {
|
||||||
if(!node.badge_enabled) {
|
if(!node.badge_enabled) {
|
||||||
const orig = node.onDrawForeground;
|
const orig = node.onDrawForeground;
|
||||||
node.getNickname = function () { return getNickname(node, node.type.trim()) };
|
node.getNickname = function () { return getNickname(node, node.type.trim()) };
|
||||||
node.onDrawForeground = function (ctx) { drawBadge(node, orig, arguments) };
|
node.onDrawForeground = function (ctx) { drawBadge(node, orig, arguments) };
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_addExtraNodeContextMenu(node, app) {
|
_addExtraNodeContextMenu(node, app) {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "comfyui-manager"
|
name = "comfyui-manager"
|
||||||
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
|
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
|
||||||
version = "2.50.3"
|
version = "2.51"
|
||||||
license = { file = "LICENSE.txt" }
|
license = { file = "LICENSE.txt" }
|
||||||
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]
|
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user