Skip to main content

A downloader for CivitAI models

Project description

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

Command-Line Usage

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

civitai-downloader <url> <output_path>

Example:

civitai-downloader https://civitai.com/api/download/models/46846 /workspace/stable-diffusion-webui/models/Stable-diffusion

If this is your first time using the downloader, it will prompt you to enter your CivitAI API token, which will be stored for future use.

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 = get_token() or '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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

civitai_downloader-0.1.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

civitai_downloader-0.1.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file civitai_downloader-0.1.1.tar.gz.

File metadata

  • Download URL: civitai_downloader-0.1.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for civitai_downloader-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a7077ae6f19e822ed5646366bc67a5c79e83d446699ddd70b1a72d34049a6b0f
MD5 ffc513e212a6f650c71296d71e880207
BLAKE2b-256 76fa0fbe201a20f91d71a74583d203c13631b12e280f4bc5f8d3f9df506a488f

See more details on using hashes here.

File details

Details for the file civitai_downloader-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for civitai_downloader-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 843c572dca279fdd18ec62bac9b34e116f5598801bb2ee91c7008c6d4b6de333
MD5 20e1470dff5235b20fff16fe5e3e9ce8
BLAKE2b-256 f3ba3d2024c27f3dd10864617c7cfc36f2e1276e11322ea0149fc61db2f4078a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page