Skip to content

Instantly share code, notes, and snippets.

@edib
Last active December 14, 2025 23:15
Show Gist options
  • Select an option

  • Save edib/9dbf27bc54809a90defa60790a183ac2 to your computer and use it in GitHub Desktop.

Select an option

Save edib/9dbf27bc54809a90defa60790a183ac2 to your computer and use it in GitHub Desktop.
ComfyUI Model Downloader
#!/usr/bin/env bash
# =============================
# ComfyUI Model Downloader
# Reads URLs from links.txt
# Places them into correct folders automatically
# =============================
COMFYUI_DIR="/workspace/ComfyUI"
LINK_FILE="links.txt"
if [ ! -f "$LINK_FILE" ]; then
echo "Error: $LINK_FILE not found. Create it and add model URLs."
exit 1
fi
echo "Starting downloads..."
while IFS= read -r URL; do
[ -z "$URL" ] && continue
REL_PATH=$(echo "$URL" | sed -n 's|.*split_files/||p')
if [ -z "$REL_PATH" ]; then
echo "⚠️ Skipping (no split_files path): $URL"
continue
fi
DIR=$(dirname "$REL_PATH")
FILE=$(basename "$REL_PATH")
DEST_DIR="$COMFYUI_DIR/models/$DIR"
mkdir -p "$DEST_DIR"
DEST_PATH="$DEST_DIR/$FILE"
if [ -f "$DEST_PATH" ]; then
echo "⏭️ Skipping (already exists): $FILE"
continue
fi
echo "⬇️ Downloading: $FILE$DEST_DIR"
wget -q --show-progress "$URL" -O "$DEST_PATH"
if [ $? -eq 0 ]; then
echo "✔️ Finished: $FILE"
else
echo "❌ Failed: $URL"
fi
done < "$LINK_FILE"
echo "🎉 All downloads complete!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment