debug: add debug output to trace execution

This commit is contained in:
2025-11-22 16:24:09 +01:00
parent e7a4daebe3
commit f4ec522cfb

View File

@@ -407,6 +407,7 @@ link_model() {
local model_type="$2" local model_type="$2"
local filename_filter="$3" local filename_filter="$3"
echo "DEBUG: link_model called for $repo_id (type: $model_type, filter: $filename_filter)" >&2
print_detail "Linking to: ${CYAN}${COMFYUI_DIR}/${model_type}/${RESET}" print_detail "Linking to: ${CYAN}${COMFYUI_DIR}/${model_type}/${RESET}"
# Create ComfyUI subdirectory if it doesn't exist # Create ComfyUI subdirectory if it doesn't exist
@@ -417,8 +418,10 @@ link_model() {
fi fi
# Find model files in cache # Find model files in cache
echo "DEBUG: Calling find_model_files..." >&2
local model_files local model_files
model_files=$(find_model_files "$repo_id" "$filename_filter") model_files=$(find_model_files "$repo_id" "$filename_filter")
echo "DEBUG: find_model_files returned: $(echo \"$model_files\" | wc -l) files" >&2
if [[ -z "$model_files" ]]; then if [[ -z "$model_files" ]]; then
print_warning "No model files found in cache for ${repo_id}" print_warning "No model files found in cache for ${repo_id}"
@@ -480,13 +483,15 @@ process_category() {
while IFS='|' read -r repo_id description size_gb essential model_type filename; do while IFS='|' read -r repo_id description size_gb essential model_type filename; do
((current++)) ((current++))
echo "" echo "" >&2
echo "DEBUG: Processing model $current/$total_models: $repo_id (type: $model_type)" >&2
print_step "$current" "$total_models" "${BOLD_MAGENTA}${description}${RESET}" print_step "$current" "$total_models" "${BOLD_MAGENTA}${description}${RESET}"
local success=true local success=true
# Download if command is 'download' or 'both' # Download if command is 'download' or 'both'
if [[ "$COMMAND" == "download" ]] || [[ "$COMMAND" == "both" ]]; then if [[ "$COMMAND" == "download" ]] || [[ "$COMMAND" == "both" ]]; then
echo "DEBUG: Downloading $repo_id" >&2
if ! download_model "$repo_id" "$description" "$size_gb"; then if ! download_model "$repo_id" "$description" "$size_gb"; then
success=false success=false
fi fi
@@ -495,6 +500,7 @@ process_category() {
# Link if command is 'link' or 'both' # Link if command is 'link' or 'both'
if [[ "$COMMAND" == "link" ]] || [[ "$COMMAND" == "both" ]]; then if [[ "$COMMAND" == "link" ]] || [[ "$COMMAND" == "both" ]]; then
if $success; then if $success; then
echo "DEBUG: Linking $repo_id to $model_type" >&2
if ! link_model "$repo_id" "$model_type" "$filename"; then if ! link_model "$repo_id" "$model_type" "$filename"; then
success=false success=false
fi fi