Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing ComfyUI-Crystools is a little slow #88

Closed
Maslino opened this issue Jul 29, 2024 · 5 comments
Closed

Importing ComfyUI-Crystools is a little slow #88

Maslino opened this issue Jul 29, 2024 · 5 comments

Comments

@Maslino
Copy link
Contributor

Maslino commented Jul 29, 2024

The import time of ComfyUI-Crystools is about 2 ~ 3 seconds on my server. It is a little slow. Can the import procedure be improved?

Expected behavior
Can the import time be less than one second? Is that possible?

Screenshots

Import times for custom nodes:
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/websocket_image_save.py
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/AIGODLIKE-COMFYUI-TRANSLATION
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/ControlNet-LLLite-ComfyUI
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI_TiledKSampler
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/FreeU_Advanced
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI-WD14-Tagger
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI_experiments
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/PowerNoiseSuite
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/images-grid-comfy-plugin
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI-Custom-Scripts
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/Derfuu_ComfyUI_ModdedNodes
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/comfyui-workspace-manager
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI_IPAdapter_plus
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/comfyui_controlnet_aux
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/stability-ComfyUI-nodes
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI_Comfyroll_CustomNodes
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI-Manager
[2024-07-29 03:20]    0.0 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI-Inspire-Pack
[2024-07-29 03:20]    0.1 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI-Marigold
[2024-07-29 03:20]    0.2 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI_FizzNodes
[2024-07-29 03:20]    0.2 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved
[2024-07-29 03:20]    0.4 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI-Impact-Pack
[2024-07-29 03:20]    0.8 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI_Custom_Nodes_AlekPet
[2024-07-29 03:20]    2.3 seconds: /home/app/ComfyUI/custom_nodes/ComfyUI-Crystools

Versions:
Copy the output of the console (4 parts), like this:

[2024-07-29 03:20] ** Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
Total VRAM 24217 MB, total RAM 362310 MB
[2024-07-29 03:20] Set vram state to: NORMAL_VRAM
[2024-07-29 03:20] [Crystools INFO] Crystools version: 1.15.0
[2024-07-29 03:20] [Crystools INFO] CPU: Intel(R) Xeon(R) Platinum 8457C - Arch: x86_64 - OS: Linux 5.4.210-4.ve1.x86_64
[2024-07-29 03:20] [Crystools INFO] Pynvml (Nvidia) initialized.
[2024-07-29 03:20] [Crystools INFO] GPU/s:
[2024-07-29 03:20] [Crystools INFO] 0) NVIDIA GeForce RTX 4090
[2024-07-29 03:20] [Crystools INFO] NVIDIA Driver: 535.86.10
[2024-07-29 03:20] ### Loading: ComfyUI-Manager (V2.48.1)
[2024-07-29 03:20] ### ComfyUI Revision: 2394 [10b43cee] *DETACHED | Released on '2024-07-24'
@Pythonpa
Copy link

The same,maybe have some solutions to speed it up

@crystian
Copy link
Owner

yeap, I tried to reduce it, but it times come from the drivers, I can't do anything, sorry

@Maslino
Copy link
Contributor Author

Maslino commented Jul 31, 2024

yeap, I tried to reduce it, but it times come from the drivers, I can't do anything, sorry

The slow import is caused by cpuinfo.get_cpu_info(). You can refer to this issue for more infomation:
workhorsy/py-cpuinfo#155

CPU frequency is not necessary. ComfyUI-Crystools only prints cpu model and arch.

The solution could be:
For windows, macos and linux, use system's specified method to get cpu base info.
For other operating systems, fallback to use cpuinfo.get_cpu_info().

@crystian
Copy link
Owner

oh! nice, I will check it!

@crystian crystian reopened this Jul 31, 2024
@crystian
Copy link
Owner

ummm, I use the release 9.0.0 that was on version 4.0.0 ¯_(ツ)_/¯

but, I reuse an object, it reduce 1 to 1 .9 seconds

try it please (1.16.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants