Zoomaker - Friendly house keeping for your AI model zoo and related resources.
Project description
Zoomaker - Friendly house keeping for your AI model zoo and related resources.
Zoomaker is a command-line tool that helps install AI models, git repositories and run scripts.
- single source of truth: all resources are neatly defined in the
zoo.yamlfile - freeze versions: know exactly which revision of a resources is installed at any time
- only download once: optimize bandwidth and cache your models locally
- optimize disk usage: downloaded models are cached
😻 TL;DR
- Install Zoomaker
pip install zoomaker - Define your resources in the
zoo.yamlfile - Run
zoomaker installto install them
📦 Installation
pip install zoomaker
🦁 zoo.yaml Examples
Example of the zoo.yaml of a Stable Diffusion project with the Automatic1111 image generator:
name: my-automatic1111-model-zoo
version: 1.0
description: Lorem ipsum
author: your name
resources:
image_generator:
- name: automatic1111
src: https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
type: git
revision: 22bcc7be428c94e9408f589966c2040187245d81
install_to: ./
models:
- name: v2-1_768-ema-pruned
src: stabilityai/stable-diffusion-2-1/v2-1_768-ema-pruned.safetensors
type: huggingface
install_to: ./stable-diffusion-webui/models/Stable-diffusion/
`zoo.yaml` example long
name: my-automatic1111-model-zoo
version: 1.0
description: Lorem ipsum
author: your name
aliases:
image_generator: &image_generator ./
models: &models ./stable-diffusion-webui/models/Stable-diffusion/
controlnet: &controlnet ./stable-diffusion-webui/models/ControlNet/
embeddings: &embeddings ./stable-diffusion-webui/embeddings/
extensions: &extensions ./stable-diffusion-webui/extensions/
resources:
image_generator:
- name: automatic1111
src: https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
type: git
revision: 22bcc7be428c94e9408f589966c2040187245d81
install_to: *image_generator
models:
- name: v1-5-pruned-emaonly
src: runwayml/stable-diffusion-v1-5/v1-5-pruned-emaonly.safetensors
type: huggingface
install_to: *models
controlnet:
- name: control_sd15_canny
src: lllyasviel/ControlNet/models/control_sd15_canny.pth
type: huggingface
install_to: *controlnet
embeddings:
- name: midjourney-style
src: sd-concepts-library/midjourney-style/learned_embeds.bin
type: huggingface
install_to: *embeddings
rename_to: midjourney-style.bin
- name: moebius
src: sd-concepts-library/moebius/learned_embeds.bin
type: huggingface
install_to: *embeddings
rename_to: moebius.bin
extensions:
- name: sd-webui-tunnels
src: https://github.com/Bing-su/sd-webui-tunnels.git
type: git
install_to: *extensions
`zoo.yaml` with script snippets
Here are a few examples of how to run scripts snippets from the zoo.yaml file. For example for starting the Automatic1111's webui, you could setup snippets like these and then run them with zoomaker run start_webui. All scripts are run from the root of the project, please adjust the paths accordingly.
scripts:
start_webui: |
cd .\stable-diffusion-webui && call webui.bat
scripts:
start_webui: |
conda activate automatic1111
cd /home/$(whoami)/stable-diffusion-webui/
./webui.sh --xformers --no-half
`zoo.yaml` with web download
resources:
models:
- name: analog-diffusion-v1
src: https://civitai.com/api/download/models/1344
type: download
install_to: ./stable-diffusion-webui/models/Stable-diffusion/
rename_to: analog-diffusion-v1.safetensors
Please note:
The resource type: download can be seen as the last resort. Existing web downloads are skipped, but no other caching. It is recommended to avoid web downloads :)
🧮 zoo.yaml Structure
Top level:
name(mandatory)version,description,author,aliases(optional)resources(mandatory) :<group-name>:[](array of resources)scripts(optional) :<script-name>
Resource:
name,src,type,install_to(mandatory)rename_to(optional)revision(optional), if none is defined the latest version from the main branch is downloadedtypecan either begit,huggingfaceordownloadapi_key(optional) for civitai
🧞 Zoomaker Commands
All commands are run from the root of the project, where also your zoo.yaml file is located.
| Command | Action |
|---|---|
zoomaker install |
Installs resources as defined in zoo.yaml |
zoomaker run <script_name> |
Run CLI scripts as defined in zoo.yaml |
zoomaker --help |
Get help using the Zoomaker CLI |
zoomaker --version |
Show current Zoomaker version |
zoomaker install -f <file> |
Installs resources as defined in the specified YAML file |
zoomaker run -f <file> <script_name> |
Run CLI scripts as defined in the specified YAML file |
🤗 Hugging Face Access Token and Custom Cache Location
You might be asked for a Hugging Face Access Token during zoomaker install. Some resources on Hugging Face require accepting the terms of use of the model. You can set your access token by running this command in a terminal. The command huggingface-cli is automatically shipped alongside zoomaker.
huggingface-cli login
You can specify a custom cache location by setting the HF_HOME environment variable. The default cache location is ~/.cache/huggingface/.
export HF_HOME=/path/to/your/cache
zoomaker install
🙏 Acknowledgements
- Most of the internal heavy lifting is done be the huggingface_hub library by Hugging Face. Thanks!
- "Zoomaker Safari Hacker Cat" cover image by Alia Tasler, based on this OpenMoji. Thanks!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zoomaker-0.10.2.tar.gz.
File metadata
- Download URL: zoomaker-0.10.2.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.9.12 Darwin/21.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a06b4e09b8ab85e4d021a9ce3eceadacedebcf119c55c352b24e05241220847f
|
|
| MD5 |
a94aac670ae09356d1239d7f4f5c35df
|
|
| BLAKE2b-256 |
5e8ae8b31beb9228015f62d50b97c2b3a0a3683fffecf39e2bf7630f918ae51a
|
File details
Details for the file zoomaker-0.10.2-py3-none-any.whl.
File metadata
- Download URL: zoomaker-0.10.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.9.12 Darwin/21.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a734dab6f466c95b3da0b1e35cc9f1aeeddd4bc642b495ea0252f50ed3a02894
|
|
| MD5 |
826dcb83308365eb398fdedec59c7b32
|
|
| BLAKE2b-256 |
5f28d180a828f0c2f894f1cc6ebb61516d9c3882303de198cdad5ce16e7d1ba4
|