comfy-cli icon indicating copy to clipboard operation
comfy-cli copied to clipboard

Fix: model download fails when server defaults to gzip

Open ansonkao opened this issue 8 months ago • 2 comments
trafficstars

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

ansonkao avatar Feb 25 '25 02:02 ansonkao

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

ansonkao avatar Feb 25 '25 02:02 ansonkao

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 :warning:
Flag Coverage Δ
unittests 44.75% <0.00%> (-0.02%) :arrow_down:

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%) :arrow_down:
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Feb 25 '25 04:02 codecov[bot]

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.

bigcat88 avatar Jul 29 '25 12:07 bigcat88