Skip to content

Conversation

@qiacheng
Copy link
Contributor

Found a bug when running comfy-cli model download --url https://huggingface.co/Comfy-Org/flux1-schnell/resolve/main/flux1-schnell-fp8.safetensors

it will fully download the model first before going into download_file(url, local_filepath, headers) .

Model gets downloaded twice, first time was to verify hf repo access, and second time was the actual download.

response = requests.get(url, headers=headers, allow_redirects=True, stream=True)

simple fix is to add stream=True to requests.get in check_unauthorized() to prevent full file download

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Sep 25, 2025
@codecov
Copy link

codecov bot commented Sep 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@           Coverage Diff           @@
##             main     #320   +/-   ##
=======================================
  Coverage   50.87%   50.87%           
=======================================
  Files          32       32           
  Lines        3444     3444           
=======================================
  Hits         1752     1752           
  Misses       1692     1692           
Files with missing lines Coverage Δ
comfy_cli/file_utils.py 55.23% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dosubot dosubot bot added the bug Something isn't working label Sep 25, 2025
@bigcat88 bigcat88 self-requested a review September 26, 2025 07:58
Copy link
Contributor

@bigcat88 bigcat88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on this, and thank you for the fix. Merging this now.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 26, 2025
@bigcat88 bigcat88 merged commit c674bc8 into Comfy-Org:main Sep 26, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants