Skip to content

Commit a952009

Browse files
committed
modified: remove uninstall/switch/disable button for ComfyUI-Manager in the list
feat: support favorites list
1 parent 6f2e134 commit a952009

File tree

6 files changed

+59
-14
lines changed

6 files changed

+59
-14
lines changed

check.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ files=(
99
"alter-list.json"
1010
"extension-node-map.json"
1111
"github-stats.json"
12+
"extras.json"
1213
"node_db/new/custom-node-list.json"
1314
"node_db/new/model-list.json"
1415
"node_db/new/extension-node-map.json"

extras.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"favorites": [
3+
"comfyui_ipadapter_plus",
4+
"comfyui-animatediff-evolved",
5+
"comfyui_controlnet_aux",
6+
"comfyui-impact-pack",
7+
"comfyui-custom-scripts",
8+
"comfyui-layerdiffuse",
9+
"comfyui-liveportraitkj",
10+
"aigodlike-comfyui-translation",
11+
"comfyui-reactor-node",
12+
"comfyui_instantid",
13+
"sd-dynamic-thresholding",
14+
"pr-was-node-suite-comfyui-47064894",
15+
"comfyui-advancedliveportrait",
16+
"comfyui_layerstyle",
17+
"efficiency-nodes-comfyui",
18+
"comfyui-crystools",
19+
"comfyui-advanced-controlnet",
20+
"comfyui-videohelpersuite",
21+
"comfyui-kjnodes",
22+
"comfy-mtb",
23+
"comfyui_essentials"
24+
]
25+
}

glob/manager_core.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2592,6 +2592,15 @@ def populate_github_stats(node_packs, json_obj_github):
25922592
v['trust'] = False
25932593

25942594

2595+
def populate_favorites(node_packs, json_obj_extras):
2596+
favorites = set(json_obj_extras['favorites'])
2597+
2598+
for k, v in node_packs.items():
2599+
if v.get('version') != 'unknown':
2600+
if k in favorites:
2601+
v['is_favorite'] = True
2602+
2603+
25952604
async def restore_snapshot(snapshot_path, git_helper_extras=None):
25962605
cloned_repos = []
25972606
checkout_repos = []

glob/manager_server.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,11 @@ async def fetch_customnode_list(request):
513513
channel = core.get_config()['channel_url']
514514

515515
node_packs = await core.get_unified_total_nodes(channel, request.rel_url.query["mode"])
516-
json_obj_github = await core.get_data_by_mode(request.rel_url.query["mode"], 'github-stats.json', 'default')
517-
core.populate_github_stats(node_packs, json_obj_github)
516+
json_obj_github = core.get_data_by_mode(request.rel_url.query["mode"], 'github-stats.json', 'default')
517+
json_obj_extras = core.get_data_by_mode(request.rel_url.query["mode"], 'extras.json', 'default')
518+
519+
core.populate_github_stats(node_packs, await json_obj_github)
520+
core.populate_favorites(node_packs, await json_obj_extras)
518521

519522
check_state_of_git_node_pack(node_packs, False, do_update_check=not skip_update)
520523

js/custom-nodes-manager.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ const ShowMode = {
338338
NORMAL: "Normal",
339339
UPDATE: "Update",
340340
MISSING: "Missing",
341+
FAVORITES: "Favorites",
341342
ALTERNATIVES: "Alternatives"
342343
};
343344

@@ -552,6 +553,10 @@ export class CustomNodesManager {
552553
label: "Missing",
553554
value: ShowMode.MISSING,
554555
hasData: false
556+
}, {
557+
label: "Favorites",
558+
value: ShowMode.FAVORITES,
559+
hasData: false
555560
}, {
556561
label: "Alternatives of A1111",
557562
value: ShowMode.ALTERNATIVES,
@@ -633,7 +638,7 @@ export class CustomNodesManager {
633638
}
634639

635640
if (rowItem?.title === "ComfyUI-Manager") {
636-
installGroups.enabled = installGroups.enabled.filter(it => it !== "disable");
641+
installGroups.enabled = installGroups.enabled.filter(it => it !== "disable" && it !== "uninstall" && it !== "switch");
637642
}
638643

639644
let list = installGroups[action];
@@ -1461,8 +1466,18 @@ export class CustomNodesManager {
14611466
return hashMap;
14621467
}
14631468

1464-
async getAlternatives() {
1469+
async getFavorites() {
1470+
const hashMap = {};
1471+
for(let k in this.custom_nodes) {
1472+
let item = this.custom_nodes[k];
1473+
if(item.is_favorite)
1474+
hashMap[item.hash] = true;
1475+
}
14651476

1477+
return hashMap;
1478+
}
1479+
1480+
async getAlternatives() {
14661481
const mode = manager_instance.datasrc_combo.value;
14671482
this.showStatus(`Loading alternatives (${mode}) ...`);
14681483
const res = await fetchData(`/customnode/alternatives?mode=${mode}`);
@@ -1545,6 +1560,8 @@ export class CustomNodesManager {
15451560
hashMap = await this.getMissingNodes();
15461561
} else if(this.show_mode == ShowMode.ALTERNATIVES) {
15471562
hashMap = await this.getAlternatives();
1563+
} else if(this.show_mode == ShowMode.FAVORITES) {
1564+
hashMap = await this.getFavorites();
15481565
}
15491566
filterItem.hashMap = hashMap;
15501567
filterItem.hasData = true;

node_db/dev/custom-node-list.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@
3232
"install_type": "git-clone",
3333
"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)"
3434
},
35-
{
36-
"author": "AIFSH",
37-
"title": "HivisionIDPhotos-ComfyUI",
38-
"reference": "https://github.com/AIFSH/HivisionIDPhotos-ComfyUI",
39-
"files": [
40-
"https://github.com/AIFSH/HivisionIDPhotos-ComfyUI"
41-
],
42-
"install_type": "git-clone",
43-
"description": "a custom node for [a/HivisionIDPhotos](https://github.com/Zeyi-Lin/HivisionIDPhotos).\nNOTE: Unsuitable for international users"
44-
},
4535
{
4636
"author": "LyazS",
4737
"title": "comfyui-nettools",

0 commit comments

Comments
 (0)