ComfyUI_Custom_Nodes_AlekPet
ComfyUI_Custom_Nodes_AlekPet copied to clipboard
Node loading is slow.
Loading this customer node takes more than 10 seconds, perhaps some adjustments to the logic could be considered
Hello. The fact is that the argotranslate uses a neural network and it installs all sorts of different things, you can simply delete it if you don’t use it, it just doesn’t save all the dependencies in the python environment.
Yes, this node took me about six or seven seconds to load, which is the longest load time of any node I have installed so far. However, if I delete the argotranslate module, the entire ComfyUI_Custom_Nodes_AlekPet node will also fail to start..... Or it will be overwritten in the next update
This is due to the import of ArgosTranslate specified in init.py and insertion into mapping. https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/master/init.py#L231-L234
https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/master/init.py#L250-L251
https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/master/init.py#L266-L267
This is due to the import of ArgosTranslate specified in init.py and insertion into mapping. https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/master/init.py#L231-L234
https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/master/init.py#L250-L251
https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/master/init.py#L266-L267
I don't think importing class and updating dict are time cost operations. In fact, I suspect the slow load is due to the module install procedure when checking modules as the following code shows:
https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/d8629270c944f2328d890d03a6a73e14c428ef75/init.py#L79-L95
The module_install function creates one subprocess and two threads which are a little heavy. Maybe the two threads are not necessary if using subprocess.check_call or subprocess.check_output instead of subprocess.Popen
This is due to the import of ArgosTranslate specified in init.py and insertion into mapping. https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/master/init.py#L231-L234
https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/master/init.py#L250-L251
https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/master/init.py#L266-L267
I don't think importing class and updating dict are time cost operations. In fact, I suspect the slow load is due to the module install procedure when checking modules as the following code shows:
https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/d8629270c944f2328d890d03a6a73e14c428ef75/init.py#L79-L95
The module_install function creates one subprocess and two threads which are a little heavy. Maybe the two threads are not necessary if using subprocess.check_call or subprocess.check_output instead of subprocess.Popen
There is no line from the code I provided, I thought you wanted to turn off ArgosTranslate, after delete folder in custom_nodes. Let's see what we can do.
This is due to the import of ArgosTranslate specified in init.py and insertion into mapping. https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/master/init.py#L231-L234 https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/master/init.py#L250-L251 https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/master/init.py#L266-L267
I don't think importing class and updating dict are time cost operations. In fact, I suspect the slow load is due to the module install procedure when checking modules as the following code shows: https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/d8629270c944f2328d890d03a6a73e14c428ef75/init.py#L79-L95
The module_install function creates one subprocess and two threads which are a little heavy. Maybe the two threads are not necessary if using subprocess.check_call or subprocess.check_output instead of subprocess.Popen
There is no line from the code I provided, I thought you wanted to turn off ArgosTranslate, after delete folder in custom_nodes. Let's see what we can do.
Oh, I misunderstood it. After deleting sub folder, some code in init.py should also be deleted. What I mentioned foreward may be another perfomance optimization point.
Yes, that’s right, you need to remove the folder from the ComfyUi_Custom_Nodes_Alekpet/ArgosTranslate folder and delete or comment out those lines where argos is imported into __init_.py
. There is another way - download the old __init__.py
(https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/blob/67b2134fb5d87d820c6c075c4015371871d8b9e3/init.py) and replace the original one, where nodes were added to my mapping automatically and also delete the folder. And this line change extensions_dirs_copy = ['js','assets', 'lib','css']
Updated __init__.py
, added check for already installed modules and other code optimizations