chrisgoringe / Comfy-Custom-Node-How-To

An unofficial practical guide to getting started developing custom nodes for ComfyUI
GNU General Public License v3.0
143 stars 5 forks source link

How to avoid duplicate loading #8

Closed wolf95985 closed 8 months ago

wolf95985 commented 8 months ago

Hi, I'm making some custom integration nodes that will have Checkpoint, CN, IPAdapter and other things, and now my trouble is that just by changing one of the other parameters, all the models will be reloaded, and I don't know if there is a way to prevent this unnecessary behavior, or any custom node that implements something similar?

chrisgoringe commented 8 months ago

In general if any input gets changed, the node will be re-executed. Without looking into code in detail it's hard to say much more - but my approach would probably be for the node to cache things it's loaded itself.