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"