Skip to content

Latest commit

 

History

History
71 lines (37 loc) · 1.66 KB

README.md

File metadata and controls

71 lines (37 loc) · 1.66 KB

CivitAI Downloader

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.

Installation

Install the package via pip:

pip install civitai-downloader

Usage

Gradio webui Usage

to run with gradio webui you can just run by this command

civitai-downloader

Command-Line Usage

To download a model from CivitAI, use the civitai-downloader command with the following arguments:

civitai-downloader <url> <output_path> <token>

Programmatic Usage

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)

Features

  • 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.

API Token

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.

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Credits

gradio demo by - Eddycrack864