modified: remove uninstall/switch/disable button for ComfyUI-Manager in the list

feat: support favorites list
This commit is contained in:
Dr.Lt.Data 2024-09-08 15:53:54 +09:00
parent 6f2e1345b2
commit a952009d4a
6 changed files with 59 additions and 14 deletions

View File

@ -9,6 +9,7 @@ files=(
"alter-list.json"
"extension-node-map.json"
"github-stats.json"
"extras.json"
"node_db/new/custom-node-list.json"
"node_db/new/model-list.json"
"node_db/new/extension-node-map.json"

25
extras.json Normal file
View File

@ -0,0 +1,25 @@
{
"favorites": [
"comfyui_ipadapter_plus",
"comfyui-animatediff-evolved",
"comfyui_controlnet_aux",
"comfyui-impact-pack",
"comfyui-custom-scripts",
"comfyui-layerdiffuse",
"comfyui-liveportraitkj",
"aigodlike-comfyui-translation",
"comfyui-reactor-node",
"comfyui_instantid",
"sd-dynamic-thresholding",
"pr-was-node-suite-comfyui-47064894",
"comfyui-advancedliveportrait",
"comfyui_layerstyle",
"efficiency-nodes-comfyui",
"comfyui-crystools",
"comfyui-advanced-controlnet",
"comfyui-videohelpersuite",
"comfyui-kjnodes",
"comfy-mtb",
"comfyui_essentials"
]
}

View File

@ -2592,6 +2592,15 @@ def populate_github_stats(node_packs, json_obj_github):
v['trust'] = False
def populate_favorites(node_packs, json_obj_extras):
favorites = set(json_obj_extras['favorites'])
for k, v in node_packs.items():
if v.get('version') != 'unknown':
if k in favorites:
v['is_favorite'] = True
async def restore_snapshot(snapshot_path, git_helper_extras=None):
cloned_repos = []
checkout_repos = []

View File

@ -513,8 +513,11 @@ async def fetch_customnode_list(request):
channel = core.get_config()['channel_url']
node_packs = await core.get_unified_total_nodes(channel, request.rel_url.query["mode"])
json_obj_github = await core.get_data_by_mode(request.rel_url.query["mode"], 'github-stats.json', 'default')
core.populate_github_stats(node_packs, json_obj_github)
json_obj_github = core.get_data_by_mode(request.rel_url.query["mode"], 'github-stats.json', 'default')
json_obj_extras = core.get_data_by_mode(request.rel_url.query["mode"], 'extras.json', 'default')
core.populate_github_stats(node_packs, await json_obj_github)
core.populate_favorites(node_packs, await json_obj_extras)
check_state_of_git_node_pack(node_packs, False, do_update_check=not skip_update)

View File

@ -338,6 +338,7 @@ const ShowMode = {
NORMAL: "Normal",
UPDATE: "Update",
MISSING: "Missing",
FAVORITES: "Favorites",
ALTERNATIVES: "Alternatives"
};
@ -552,6 +553,10 @@ export class CustomNodesManager {
label: "Missing",
value: ShowMode.MISSING,
hasData: false
}, {
label: "Favorites",
value: ShowMode.FAVORITES,
hasData: false
}, {
label: "Alternatives of A1111",
value: ShowMode.ALTERNATIVES,
@ -633,7 +638,7 @@ export class CustomNodesManager {
}
if (rowItem?.title === "ComfyUI-Manager") {
installGroups.enabled = installGroups.enabled.filter(it => it !== "disable");
installGroups.enabled = installGroups.enabled.filter(it => it !== "disable" && it !== "uninstall" && it !== "switch");
}
let list = installGroups[action];
@ -1461,8 +1466,18 @@ export class CustomNodesManager {
return hashMap;
}
async getAlternatives() {
async getFavorites() {
const hashMap = {};
for(let k in this.custom_nodes) {
let item = this.custom_nodes[k];
if(item.is_favorite)
hashMap[item.hash] = true;
}
return hashMap;
}
async getAlternatives() {
const mode = manager_instance.datasrc_combo.value;
this.showStatus(`Loading alternatives (${mode}) ...`);
const res = await fetchData(`/customnode/alternatives?mode=${mode}`);
@ -1545,6 +1560,8 @@ export class CustomNodesManager {
hashMap = await this.getMissingNodes();
} else if(this.show_mode == ShowMode.ALTERNATIVES) {
hashMap = await this.getAlternatives();
} else if(this.show_mode == ShowMode.FAVORITES) {
hashMap = await this.getFavorites();
}
filterItem.hashMap = hashMap;
filterItem.hasData = true;

View File

@ -32,16 +32,6 @@
"install_type": "git-clone",
"description": "Basic functionality for converting an image to ASCII art returned as a png image based on [a/ascii_magic](https://github.com/LeandroBarone/python-ascii_magic)"
},
{
"author": "AIFSH",
"title": "HivisionIDPhotos-ComfyUI",
"reference": "https://github.com/AIFSH/HivisionIDPhotos-ComfyUI",
"files": [
"https://github.com/AIFSH/HivisionIDPhotos-ComfyUI"
],
"install_type": "git-clone",
"description": "a custom node for [a/HivisionIDPhotos](https://github.com/Zeyi-Lin/HivisionIDPhotos).\nNOTE: Unsuitable for international users"
},
{
"author": "LyazS",
"title": "comfyui-nettools",