This script requires a CivitAI API key. You can create the API key as follows:
- Log into CivitAI.
- Go to the Manage Account page.
- Scroll down to the
API Keyssection, close to the bottom of the page. - Click the
+ Add API keybutton to create a new API key. - Give the API key a name and click the
Savebutton. - You will then use your newly created API key with this script.
curl -L https://raw.githubusercontent.com/ashleykleynhans/civitai-downloader/main/download.py -o /usr/local/bin/download-model
chmod +x /usr/local/bin/download-modelNote
This assumes you are using RunPod and logged in as root
user. If not, the installation commands should be prefixed
with sudo.
Important
It is important to ensure that you use the DOWNLOAD link
and not the link to the model page in CivitAI.
You can get the model id even from CivitAI main url. Eg. https://civitai.com/models/1234567?modelVersionId=46846 the model_id will be 46846
download-model [MODEL_ID] [DESTINATION]To download to the current directory:
download-model 46846 .To download to a different directory:
download-model 46846 /workspace/stable-diffusion-webui/models/Stable-diffusionPull requests and issues on GitHub are welcome. Bug fixes and new features are encouraged.
