[GH-ISSUE #914] Executing git_helper.py script is slow #397

Closed
opened 2026-10-27 21:17:06 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @Maslino on GitHub (Jul 31, 2024).
Original GitHub issue: https://github.com/Comfy-Org/ComfyUI-Manager/issues/914

In git_helper.py script, there is an import:

from torchvision.datasets.utils import download_url

which will import torchvision and torch and this import procedure costs about 2 seconds on my desktop.

Only the download_url function from the big torch package is used. Maybe we should avoid this import and take other measures to improve performance. Because git_helper.py is widely used in ComfyUI-Manager as subprocess.

Originally created by @Maslino on GitHub (Jul 31, 2024). Original GitHub issue: https://github.com/Comfy-Org/ComfyUI-Manager/issues/914 In git_helper.py script, there is an import: ```python from torchvision.datasets.utils import download_url ``` which will import torchvision and torch and this import procedure costs about 2 seconds on my desktop. Only the download_url function from the big torch package is used. Maybe we should avoid this import and take other measures to improve performance. Because git_helper.py is widely used in ComfyUI-Manager as subprocess.
bsakaguchi 2026-10-27 21:17:06 +00:00
Author
Owner

@ltdrdata commented on GitHub (Jul 31, 2024):

Oh.. Yeah.. I need to patch this.

<!-- gh-comment-id:2261553535 --> @ltdrdata commented on GitHub (Jul 31, 2024): Oh.. Yeah.. I need to patch this.
Author
Owner

@Maslino commented on GitHub (Aug 1, 2024):

How to visualize import time:

python -X importtime  ComfyUI-Manager/git_helper.py  --apply-snapshot 2024-07-31_11-19-36_snapshot.json 2>import.log

pip install tuna

tuna import.log

git_helper_import_time

<!-- gh-comment-id:2262191957 --> @Maslino commented on GitHub (Aug 1, 2024): How to visualize import time: ```bash python -X importtime ComfyUI-Manager/git_helper.py --apply-snapshot 2024-07-31_11-19-36_snapshot.json 2>import.log pip install tuna tuna import.log ``` ![git_helper_import_time](https://github.com/user-attachments/assets/222b132b-9f16-43e5-876b-e59d98ef2181)
Author
Owner

@ltdrdata commented on GitHub (Aug 1, 2024):

This is patched.

<!-- gh-comment-id:2263482775 --> @ltdrdata commented on GitHub (Aug 1, 2024): This is patched.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/ComfyUI-Manager#397
No description provided.