From c9d1ededf20879c28a27d6ce01f7e22245b96a35 Mon Sep 17 00:00:00 2001 From: Anson Kao Date: Mon, 24 Feb 2025 21:19:37 -0500 Subject: [PATCH 1/2] Prevent gzip when downloading models @ models.py --- comfy_cli/command/models/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/comfy_cli/command/models/models.py b/comfy_cli/command/models/models.py index 9aee4516..a24e0ccc 100644 --- a/comfy_cli/command/models/models.py +++ b/comfy_cli/command/models/models.py @@ -305,6 +305,9 @@ def download( ) print(f"Model downloaded successfully to: {output_path}") else: + headers = { + "Accept-Encoding": "identity", # Prevent gzip and chunking which the expectation of Content-Length, which is needed for progress bars. Also, it's slower. + } print(f"Start downloading URL: {url} into {local_filepath}") download_file(url, local_filepath, headers) From 66ab0505f3e7ca3afe3acaa1c507bc657403dc78 Mon Sep 17 00:00:00 2001 From: Anson Kao Date: Mon, 24 Feb 2025 21:24:05 -0500 Subject: [PATCH 2/2] Update comment in models.py --- comfy_cli/command/models/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy_cli/command/models/models.py b/comfy_cli/command/models/models.py index a24e0ccc..6ef2514b 100644 --- a/comfy_cli/command/models/models.py +++ b/comfy_cli/command/models/models.py @@ -306,7 +306,7 @@ def download( print(f"Model downloaded successfully to: {output_path}") else: headers = { - "Accept-Encoding": "identity", # Prevent gzip and chunking which the expectation of Content-Length, which is needed for progress bars. Also, it's slower. + "Accept-Encoding": "identity", # Prevent gzip and chunking. Chunking breaks Content-Length, which is needed for progress bars in download_file. Also, gzip is slower. } print(f"Start downloading URL: {url} into {local_filepath}") download_file(url, local_filepath, headers)