mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-05 07:47:25 +00:00
[GH-ISSUE #735] I've made a new feature for the for reaching the most frequently used node faster in client-side, but I don't know where should I PR to. #333
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/ComfyUI-Manager#333
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @liusida on GitHub (Jun 2, 2024).
Original GitHub issue: https://github.com/Comfy-Org/ComfyUI-Manager/issues/735
Description of the new feature:
The right-click context menu currently only contains a static list of nodes, which often isn't very helpful. To address this, I've implemented a feature that traces the creation of all nodes. When building the right-click context menu, the top three most frequently created nodes will be listed after the 'Search' section.
This functionality is implemented entirely in JavaScript, with the information stored in localStorage.getItem("nodeSelectionFrequency") as a dictionary.
For the proof of concept, I modified litegraph.core.js, adding about 20 lines of code, and it works well.
However, I've noticed that comfyanonymous/ComfyUI rarely modifies this file; it is only updated when changes are made upstream. The original jagenjo/litegraph.js has not been updated for five months, and it appears they might be planning a feature-less rewrite of the code before adding new features.
Considering this, I am wondering if I should implement this feature in ComfyUI-Manager by using injection to modify the behavior of the original JavaScript functionality.
===
FYI, I'll attach the code I've added for a proof-of-concept:
@atlasan commented on GitHub (Jun 2, 2024):
Nice feature!
I would try to push those to
LiteGraph.slot_types_default_outand see if that is enough. ^_^Regarding this and many other features implementation, I'm currently working on a solution to callbacks that should enable multi extensions to works together allowing to register and return data for the same event without overriding the original (and others) behaviors. Stay tuned.
@liusida commented on GitHub (Jun 2, 2024):
I see. So I probably should be working on this file:
https://github.com/comfyanonymous/ComfyUI/blob/master/web/extensions/core/slotDefaults.js
And I think I'll need a callback from the creation of nodes to update the default list, so I should create a static function
LGraph.onNodeAdded(node)to get the callback... Let me try it out. Thanks.@ltdrdata commented on GitHub (Nov 18, 2024):
I missed this issue, so my response is quite late.
It’s probably already resolved, but PRs related to the front-end should now be submitted to the front repository.
https://github.com/Comfy-Org/ComfyUI_frontend