Merge branch 'feat/cacheless-v2' into draft-v4

This commit is contained in:
Dr.Lt.Data
2025-04-12 20:11:33 +09:00
11 changed files with 162 additions and 58 deletions

View File

@@ -189,8 +189,7 @@ docStyle.innerHTML = `
}
`;
function is_legacy_front() {
let compareVersion = '1.2.49';
function isBeforeFrontendVersion(compareVersion) {
try {
const frontendVersion = window['__COMFYUI_FRONTEND_VERSION__'];
if (typeof frontendVersion !== 'string') {
@@ -223,6 +222,9 @@ function is_legacy_front() {
}
}
const is_legacy_front = () => isBeforeFrontendVersion('1.2.49');
const isNotNewManagerUI = () => isBeforeFrontendVersion('1.16.4');
document.head.appendChild(docStyle);
var update_comfyui_button = null;
@@ -476,9 +478,9 @@ async function updateComfyUI() {
// set_inprogress_mode();
showTerminal();
batch_id = generateUUID();
let batch = {};
batch['batch_id'] = batch_id;
batch['update_comfyui'] = true;
@@ -671,7 +673,7 @@ async function onQueueStatus(event) {
if(batch_id != event.detail.batch_id) {
return;
}
let success_list = [];
let failed_list = [];
let comfyui_state = null;
@@ -778,7 +780,7 @@ async function updateAll(update_comfyui) {
showTerminal();
batch_id = generateUUID();
let batch = {};
if(update_comfyui) {
update_all_button.innerText = "Updating ComfyUI...";
@@ -1516,7 +1518,10 @@ app.registerExtension({
}).element
);
app.menu?.settingsGroup.element.before(cmGroup.element);
const shouldShowLegacyMenuItems = isNotNewManagerUI();
if (shouldShowLegacyMenuItems) {
app.menu?.settingsGroup.element.before(cmGroup.element);
}
}
catch(exception) {
console.log('ComfyUI is outdated. New style menu based features are disabled.');

View File

@@ -1533,7 +1533,7 @@ export class CustomNodesManager {
else {
this.batch_id = generateUUID();
batch['batch_id'] = this.batch_id;
const res = await api.fetchApi(`/v2/manager/queue/batch`, {
method: 'POST',
body: JSON.stringify(batch)
@@ -1548,7 +1548,7 @@ export class CustomNodesManager {
errorMsg = `[FAIL] ${item.title}`;
}
}
this.showStop();
showTerminal();
}
@@ -1556,6 +1556,9 @@ export class CustomNodesManager {
async onQueueStatus(event) {
let self = CustomNodesManager.instance;
// If legacy manager front is not open, return early (using new manager front)
if (self.element?.style.display === 'none') return
if(event.detail.status == 'in_progress' && event.detail.ui_target == 'nodepack_manager') {
const hash = event.detail.target;