Last active
December 14, 2025 23:15
-
-
Save edib/9dbf27bc54809a90defa60790a183ac2 to your computer and use it in GitHub Desktop.
ComfyUI Model Downloader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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