Skip to main content

Multi Model Get - A library to download files from various sources including Hugging Face and Civitai

Project description

mmget - Multi Model Get

mmget is a Python library that simplifies downloading files from various sources including regular URLs, Hugging Face, and CivitAI. It provides a unified interface for managing model downloads with support for authentication tokens and customizable download paths.

Features

  • Download files from regular URLs
  • Download models from Hugging Face using access tokens
  • Download models from CivitAI using access tokens
    • Interactive version selection when multiple versions are available (Jupyter only)
    • Customizable download paths for different software (A1111, ComfyUI) based on model types
  • Jupyter notebook integration with GUI interface
  • Works in console environment

Screenshot 2024-11-05 at 2 22 18 AM

Installation

You can install mmget using pip:

pip install mmget

Usage

from mmget import mmget

mmget(
  hf_token = "" # Hugging Face Access Token [Optional]
  civitai_token = "" # CivitAI Access Token [Optional]
).dl(
  # Download FLUX-1 Dev Model (Access Token Required) to "Download Paths"
  "https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/flux1-dev.safetensors",
  "downloads"
).dl(
  # Download CivitaAI Model to ComfyUI that will be saved to downloads/comfyui/models/loras
  "https://civitai.com/models/7525/1-mb-lora-trained-in-5-mins-that-does-the-same-thing-as-25-gb-model-but-better",
  "downloads/comfyui",
  dest_type="comfyui"
).run()

CivitAI

When downloading models from CivitAI, you may encounter multiple available versions. In Jupyter notebooks, mmget will display an interactive interface allowing you to choose from the available versions. When running from the console, it will display the available versions and pause the download process until you specify a version.

Moreover, if you set the dest_type is either of "a1111" or "comfyui" , it will find check the type of the model and determine the subfolder to be used.

from mmget import mmget

mget(
  civitai_token = "" # It is needed if the author require download to have a civitai account
).dl(
  "https://civitai.com/models/257749/pony-diffusion-v6-xl",
  version="V6 (start with this one)",
  dest_type="comfyui"
).run()

Hugging Face

Finding the URL of a file inside hugging face is easy. Open the "Files and versions" tab, and choose the file, right click and copy link address.

TBD: Screenshot

mmget(
  hf_token = "" # Hugging Face Access Token [Optional]
).dl(
  # Download FLUX-1 Dev Model (Access Token Required) to "Download Paths"
  "https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/flux1-dev.safetensors",
  "downloads"
).run()

Environment Variables

mmget reads several environment variables:

  • MMGET_CIVITAI_TOKEN - CivitAI access token for downloading models that require authentication
  • MMGET_HF_TOKEN - Hugging Face access token for downloading models that require authentication
  • MMGET_DEST_PATH - The default distribution path for all downloads if not specified
  • MMGET_DEST_TYPE - The default distribution type (e.g. "a1111" or "comfyui") for all downloads if not specified
from dotenv import load_dotenv
from mmget import mmget
load_dotenv() # Load environment variable from .env

mmget(
).dl( 
  # URL
).run()

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

mmget-0.1.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mmget-0.1.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file mmget-0.1.0.tar.gz.

File metadata

  • Download URL: mmget-0.1.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for mmget-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9dfb4efee8c9d1488b653f2b194f8ed6c87351f5e68e7e3eeae33416a0f71434
MD5 7a7dce49304b73e8005fcea23dcbe176
BLAKE2b-256 b806a194d600524ef05cb31e452d64a317643037d9f55f930b20298f5afb2b0c

See more details on using hashes here.

File details

Details for the file mmget-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mmget-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for mmget-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0eb7e75ce1f5b902bccc7b90abe3072f2ea645b31e09c763517438b5a47cbb17
MD5 d5d5500f555b477a151ee6f18b6dce0f
BLAKE2b-256 dafac521db208f9f70eb9c08644505e2dd0d56d30eaa73ba6435fadd72923049

See more details on using hashes here.

Supported by

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