improve: menu item layouts in new style menu

This commit is contained in:
Dr.Lt.Data 2024-07-07 10:15:15 +09:00
parent 5dbe436ea9
commit a539f6bbca
3 changed files with 36 additions and 15 deletions

View File

@ -23,7 +23,7 @@ sys.path.append(glob_path)
import cm_global
from manager_util import *
version = [2, 45, 1]
version = [2, 46]
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')

View File

@ -1306,21 +1306,21 @@ app.registerExtension({
menu.append(separator);
try {
// new style Manager button
app.menu?.saveButton.element.after(new(await import("../../scripts/ui/components/button.js")).ComfyButton({
icon: "puzzle",
action: () => {
if(!manager_instance)
setManagerInstance(new ManagerMenuDialog());
manager_instance.show();
},
tooltip: "ComfyUI Manager",
content: "ComfyUI Manager",
classList: "comfyui-button comfyui-menu-mobile-collapse primary"
}).element);
// new style Manager buttons
// unload models button into new style Manager button
let cmGroup = new (await import("../../scripts/ui/components/buttonGroup.js")).ComfyButtonGroup(
new(await import("../../scripts/ui/components/button.js")).ComfyButton({
icon: "puzzle",
action: () => {
if(!manager_instance)
setManagerInstance(new ManagerMenuDialog());
manager_instance.show();
},
tooltip: "ComfyUI Manager",
content: "Manager",
classList: "comfyui-button comfyui-menu-mobile-collapse primary"
}).element,
new(await import("../../scripts/ui/components/button.js")).ComfyButton({
icon: "vacuum-outline",
action: () => {
@ -1333,7 +1333,28 @@ app.registerExtension({
action: () => {
free_models(true);
},
tooltip: "Unload Whole Cache"
tooltip: "Free model and node cache"
}).element,
new(await import("../../scripts/ui/components/button.js")).ComfyButton({
icon: "share",
action: () => {
if (share_option === 'openart') {
showOpenArtShareDialog();
return;
} else if (share_option === 'matrix' || share_option === 'comfyworkflows') {
showShareDialog(share_option);
return;
} else if (share_option === 'youml') {
showYouMLShareDialog();
return;
}
if(!ShareDialogChooser.instance) {
ShareDialogChooser.instance = new ShareDialogChooser();
}
ShareDialogChooser.instance.show();
},
tooltip: "Share"
}).element
);

View File

@ -1,7 +1,7 @@
[project]
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."
version = "2.45.1"
version = "2.46"
license = "LICENSE"
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]