ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Cache /object_info

Open miabrahams opened this issue 10 months ago • 3 comments

If you have a lot of custom nodes installed, it can take a while to iterate through all of them. This takes page reload from 5s to under 1s on my machine.

AFAIK new nodes are never added after startup so the cache remains valid.

miabrahams avatar Apr 25 '24 01:04 miabrahams

If this method is applied, the refresh will not be reflected.

ltdrdata avatar Apr 25 '24 02:04 ltdrdata

I see I see, hmm. One option would be to create a "quick reload" route and "full refresh" route. The latter would only happen when you press the button, so f5 and new tab would be faster. But many users likely hit f5 to do a full refresh, so it would be an unexpected change in behavior.

I don't have another good solution off the top of my head.

miabrahams avatar Apr 25 '24 03:04 miabrahams

I've previously implemented the same (object_info cache) in Swarm, and yes what you said last is basically the route I took and the route I recommend to be added into Comfy proper: have the refresh button call a dedicated Refresh route, rather than just pinging the get_object_info route that gets hit often on load and elsewhere

mcmonkey4eva avatar Jun 29 '24 00:06 mcmonkey4eva

Closing as while this is a good idea that should be added imo, this is not a complete solution, and any change to such a critical core function needs to be very carefully built

mcmonkey4eva avatar Sep 24 '24 08:09 mcmonkey4eva