From c1c4052054300b9d6214fdf669b96db5c17c0d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sat, 22 Nov 2025 16:02:38 +0100 Subject: [PATCH] fix: correct HuggingFace cache path detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Check for models in cache_dir/models--xxx--yyy/ first - Fallback to cache_dir/hub/models--xxx--yyy/ for compatibility - Fixes issue where script couldn't find downloaded models 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- artifact_comfyui_download.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/artifact_comfyui_download.sh b/artifact_comfyui_download.sh index 0966f56..5c16f9b 100755 --- a/artifact_comfyui_download.sh +++ b/artifact_comfyui_download.sh @@ -307,11 +307,16 @@ cache_dir = '${CACHE_DIR}' repo_id = '${repo_id}' filename_filter = '${filename_filter}' -# HuggingFace cache structure: cache_dir/hub/models--org--name/snapshots/hash/ -cache_path = Path(cache_dir) / 'hub' +# HuggingFace cache structure: cache_dir/models--org--name/snapshots/hash/ +# Try both with and without 'hub/' subdirectory for compatibility +cache_path = Path(cache_dir) repo_path = repo_id.replace('/', '--') model_dir = cache_path / f'models--{repo_path}' +# Fallback to hub/ subdirectory if direct path doesn't exist +if not model_dir.exists(): + model_dir = cache_path / 'hub' / f'models--{repo_path}' + if not model_dir.exists(): sys.exit(1)