Skip to content

Conversation

@ansonkao
Copy link

gzip breaks Content-Length and makes downloads slower.
Content-Length is expected by the progress-bar logger in download_file()

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Feb 25, 2025
@ansonkao
Copy link
Author

Confirming this resolved an issue I had with a CDN I was downloading files from

@ansonkao ansonkao changed the title Prevent gzip when downloading models @ models.py Fix: model download fails when server defaults to gzip Feb 25, 2025
@codecov
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
comfy_cli/command/models/models.py 0.00% 1 Missing ⚠️
Flag Coverage Δ
unittests 44.75% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
comfy_cli/command/models/models.py 32.98% <0.00%> (-0.18%) ⬇️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bigcat88
Copy link
Contributor

Hi, thanks for the PR and for sharing your fix.

I have some reservations about forcing Accept-Encoding: identity for all downloads. While I see it solved the problem for you, it could make downloads a lot slower for most other users where server-side compression is working as intended.

Technically, gzip shouldn't make downloads slower; the server should understand and choose if the compression should take place or not.

Could you please share a URL that lets us reproduce the problem? I am just worried about merging a fix for a specific case that could slow things down for everyone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 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