Skip to content

Instantly share code, notes, and snippets.

@ryanontheinside
Created June 9, 2025 14:15
Show Gist options
  • Save ryanontheinside/5221b7e31e6e620805c27cc353eab82d to your computer and use it in GitHub Desktop.
Save ryanontheinside/5221b7e31e6e620805c27cc353eab82d to your computer and use it in GitHub Desktop.
wget reference for comfyui models

Model Download Reference for Remote Servers

Quick reference for downloading models using wget on remote servers like RunPod.

General Tips

  • Use --content-dispostion to keep the source file's name
  • Use -O filename to specify output filename
  • Use -c to continue partial downloads
  • Use -q for quiet mode (less verbose output)
  • Use --progress=bar:force for progress bar
  • Always quote URLs containing special characters

Civitai

Add API token to download URL:

# Single parameter
wget "https://civitai.com/api/download/models/12345?token=YOUR_TOKEN_HERE"

# Multiple parameters (append with &)
wget "https://civitai.com/api/download/models/128713?type=Model&format=SafeTensor&size=pruned&fp=fp16&token=YOUR_TOKEN_HERE"

Important: Always wrap URLs with & symbols in quotes when using command line.

HuggingFace

Public Models

# Direct download
wget "https://huggingface.co/username/model-name/resolve/main/model.safetensors"

# With specific revision/branch
wget "https://huggingface.co/username/model-name/resolve/revision-hash/model.safetensors"

Private/Gated Models

# Using access token
wget --header="Authorization: Bearer YOUR_HF_TOKEN" "https://huggingface.co/username/model-name/resolve/main/model.safetensors"

Google Drive

# For files with direct share links
wget --no-check-certificate "https://drive.google.com/uc?export=download&id=FILE_ID" -O filename.safetensors

# For large files (may require confirmation)
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILE_ID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILE_ID" -O filename.safetensors && rm -rf /tmp/cookies.txt

Dropbox

# Change dl=0 to dl=1 in shared link
wget "https://www.dropbox.com/s/sharelink/filename.safetensors?dl=1"

Example with options:

wget -c -q --progress=bar:force -O "model.safetensors" "https://example.com/model?token=abc123"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment