From ab4e0d38e179ae34d1f3923e65a4296e336a0a4e Mon Sep 17 00:00:00 2001 From: Hayden <48267247+hayden-fr@users.noreply.github.com> Date: Fri, 28 Mar 2025 17:23:41 +0800 Subject: [PATCH] Error file size (#170) * Information providing wrong file size * prepare release 2.5.5 --- py/download.py | 6 ++++-- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/py/download.py b/py/download.py index 3d7455c..528dd6b 100644 --- a/py/download.py +++ b/py/download.py @@ -457,8 +457,10 @@ class ModelDownload: # When parsing model information from HuggingFace API, # the file size was not found and needs to be obtained from the response header. - if total_size == 0: - total_size = float(response.headers.get("content-length", 0)) + # Fixed issue #169. Some model information from Civitai, providing the wrong file size + response_total_size = float(response.headers.get("content-length", 0)) + if total_size == 0 or total_size != response_total_size: + total_size = response_total_size task_content.sizeBytes = total_size task_status.totalSize = total_size self.set_task_content(task_id, task_content) diff --git a/pyproject.toml b/pyproject.toml index b575711..e9b726b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-model-manager" description = "Manage models: browsing, download and delete." -version = "2.5.4" +version = "2.5.5" license = { file = "LICENSE" } dependencies = ["markdownify"]