From 1f94435d3617c2dbcf34853bf34be91fbf643f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sat, 22 Nov 2025 17:02:41 +0100 Subject: [PATCH] feat: add model name prefix to all linked files Extract model name from repo_id (e.g., 'musicgen-medium' from 'facebook/musicgen-medium') and prefix all linked files with it for better organization and clarity. Examples: - pytorch_model.bin -> musicgen-medium-pytorch_model.bin - model.safetensors -> musicgen-small-model.safetensors --- artifact_comfyui_download.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/artifact_comfyui_download.sh b/artifact_comfyui_download.sh index 18ba9cd..b22405a 100755 --- a/artifact_comfyui_download.sh +++ b/artifact_comfyui_download.sh @@ -429,23 +429,31 @@ link_model() { return 1 fi + # Extract model name from repo_id for prefixing filenames + # e.g., "facebook/musicgen-medium" -> "musicgen-medium" + local model_name=$(echo "$repo_id" | sed 's/.*\///') + local linked_count=0 while IFS= read -r source_file; do if [[ -f "$source_file" ]]; then local filename=$(basename "$source_file") - local link_path="${target_dir}/${filename}" + + # Add model name prefix to filename for better organization + # e.g., "pytorch_model.bin" -> "musicgen-medium-pytorch_model.bin" + local prefixed_filename="${model_name}-${filename}" + local link_path="${target_dir}/${prefixed_filename}" # Remove existing symlink or file if it exists if [[ -L "$link_path" ]]; then rm -f "$link_path" elif [[ -e "$link_path" ]]; then - print_warning "File already exists (not a symlink): ${filename}" + print_warning "File already exists (not a symlink): ${prefixed_filename}" continue fi # Create symlink ln -s "$source_file" "$link_path" - print_detail "${LINK} Linked: ${DIM}${filename}${RESET}" + print_detail "${LINK} Linked: ${DIM}${prefixed_filename}${RESET}" linked_count=$((linked_count+1)) fi done <<< "$model_files"