semvec/pypi-packages huggingface dataset:
civitai-downloader 1.3.5
A downloader for CivitAI models
Requires Python: >=3.6
Keywords: CivitAI downloader gradio

# 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:

```bash
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:

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



### Programmatic Usage

You can also use the downloader in your own Python scripts.

```python
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](https://civitai.com/settings).

## License

This project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details.

## Credits

gradio demo by - [Eddycrack864](https://github.com/Eddycrack864)