A Python package for downloading models from CivitAI via a command-line tool or programmatically. This package supports token-based authentication and allows users to save downloaded models to a specified directory.
Install the package via pip:
pip install civitai-downloader
to run with gradio webui you can just run by this command
civitai-downloader
To download a model from CivitAI, use the civitai-downloader
command with the following arguments:
civitai-downloader <url> <output_path> <token>
You can also use the downloader in your own Python scripts.
from civitai_downloader import download_file, get_token, store_token
url = 'https://civitai.com/api/download/models/46846'
output_path = '/path/to/save'
token = 'your_api_token_here'
download_file(url, output_path, token)
- Token-based authentication: Automatically stores your CivitAI API token for future use.
- Progress tracking: Shows download progress with speed in MB/s.
- Error handling: Includes handling for common download errors like redirects and missing files.
The first time you use civitai_downloader
, you'll be prompted to enter your CivitAI API token. This token will be stored in ~/.civitai/config
. You can generate your API token from your CivitAI account settings.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
gradio demo by - Eddycrack864