From eba33bda70ce7365dd4f186557591cef31d104c5 Mon Sep 17 00:00:00 2001 From: vladmandic Date: Sun, 26 Oct 2025 12:02:20 -0400 Subject: [PATCH] cleanup hf download Signed-off-by: vladmandic --- CHANGELOG.md | 6 ++++++ modules/modelloader.py | 36 +++++++++++------------------------- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a7be2368..f85fb4c28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ ### Highlights for 2025-10-26 +- Reorganization of **Reference Models** into *Base, Quantized, Distilled and Community* sections for easier navigation +- New **Tencent HunyuanImage 2.1** model capable of generating 2K images natively +- New **offline mode** to use previously downloaded models without internet connection +- Fixes, fixes, fixes... too many to list here! + ### Details for 2025-10-26 - **Reference** networks section is now split into actual *Base* models plus: @@ -23,6 +28,7 @@ - **Backend** - switch to `torch==2.9` for *ipex, rocm and openvino* - switch to `rocm==7.0` for nightlies + - log `triton` availability on startup - **Quantization** - improved **SDNQ SVD** and low-bit matmul performance - **Other** diff --git a/modules/modelloader.py b/modules/modelloader.py index 42866dca3..9edf51a9d 100644 --- a/modules/modelloader.py +++ b/modules/modelloader.py @@ -84,32 +84,18 @@ def download_diffusers_model(hub_id: str, cache_dir: str = None, download_config if token is not None and len(token) > 2: hf_login(token) pipeline_dir = None - - ok = False - err = None - """ - if not ok: - try: - pipeline_dir = DiffusionPipeline.download(hub_id, **download_config) - ok = True - except Exception as e: - err = e - ok = False - debug(f'HF download error: id="{hub_id}" {e}') - """ - if not ok and 'Repository Not Found' not in str(err): - try: - download_config.pop('load_connected_pipeline', None) - download_config.pop('variant', None) - pipeline_dir = hf.snapshot_download(hub_id, **download_config) - except Exception as e: - debug(f'HF download error: id="{hub_id}" {e}') - if 'gated' in str(e): - shared.log.error(f'HF download error: id="{hub_id}" model access requires login') - shared.state.end(jobid) - return None + try: + download_config.pop('load_connected_pipeline', None) + download_config.pop('variant', None) + pipeline_dir = hf.snapshot_download(hub_id, **download_config) + except Exception as e: + debug(f'HF download error: id="{hub_id}" {e}') + if 'gated' in str(e): + shared.log.error(f'HF download error: id="{hub_id}" model access requires login') + shared.state.end(jobid) + return None if pipeline_dir is None: - shared.log.error(f'HF download error: id="{hub_id}" {err}') + shared.log.error(f'HF download error: id="{hub_id}" no data') shared.state.end(jobid) return None try: