Package: zoomaker
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 thezoo.yamlfilefreeze versions: know exactly which revision of a resources is installed at any timeonly download once: optimize bandwidth and cache your models locallyoptimize disk usage: downloaded models are symlinked to the installation folder (small files <5MB are duplicate)😻 TL;DRInstall Zoomakerpip install zoomakerDefine your resources in thezoo.yamlfileRunzoomaker installto install them
(on Windows:zoomaker install --no-symlinks, seehintsbelow)📦 Installationpipinstallzoomaker🦁 zoo.yaml ExamplesExample of thezoo.yamlof a Stable Diffusion project with theAutomatic1111image generator:name:my-automatic1111-model-zooversion:1.0description:Lorem ipsumauthor:your nameresources:image_generator:-name:automatic1111src:https://github.com/AUTOMATIC1111/stable-diffusion-webui.gittype:gitrevision:22bcc7be428c94e9408f589966c2040187245d81install_to:./models:-name:v2-1_768-ema-prunedsrc:stabilityai/stable-diffusion-2-1/v2-1_768-ema-pruned.safetensorstype:huggingfaceinstall_to:./stable-diffusion-webui/models/Stable-diffusion/`zoo.yaml` example longname:my-automatic1111-model-zooversion:1.0description:Lorem ipsumauthor:your namealiases: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:automatic1111src:https://github.com/AUTOMATIC1111/stable-diffusion-webui.gittype:gitrevision:22bcc7be428c94e9408f589966c2040187245d81install_to:*image_generatormodels:-name:v1-5-pruned-emaonlysrc:runwayml/stable-diffusion-v1-5/v1-5-pruned-emaonly.safetensorstype:huggingfaceinstall_to:*modelscontrolnet:-name:control_sd15_cannysrc:lllyasviel/ControlNet/models/control_sd15_canny.pthtype:huggingfaceinstall_to:*controlnetembeddings:-name:midjourney-stylesrc:sd-concepts-library/midjourney-style/learned_embeds.bintype:huggingfaceinstall_to:*embeddingsrename_to:midjourney-style.bin-name:moebiussrc:sd-concepts-library/moebius/learned_embeds.bintype:huggingfaceinstall_to:*embeddingsrename_to:moebius.binextensions:-name:sd-webui-tunnelssrc:https://github.com/Bing-su/sd-webui-tunnels.gittype:gitinstall_to:*extensions`zoo.yaml` with script snippetsHere are a few examples of how to run scripts snippets from thezoo.yamlfile. For example for starting the Automatic1111's webui, you could setup snippets like these and then run them withzoomaker 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.batscripts:start_webui:|conda activate automatic1111cd /home/$(whoami)/stable-diffusion-webui/./webui.sh --theme dark --xformers --no-half`zoo.yaml` with web downloadresources:models:-name:analog-diffusion-v1src:https://civitai.com/api/download/models/1344type:downloadinstall_to:./stable-diffusion-webui/models/Stable-diffusion/rename_to:analog-diffusion-v1.safetensorsPlease note:
The resourcetype: downloadcan be seen as the last resort. Currently there is no caching or symlinking of web downloads. Recommended to avoid it :)🧮 zoo.yaml StructureTop 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,huggingfaceordownload🧞 Zoomaker CommandsAll commands are run from the root of the project, where also yourzoo.yamlfile is located.CommandActionzoomaker installInstalls resources as defined inzoo.yamlzoomaker run <script_name>Run CLI scripts as defined inzoo.yamlzoomaker --helpGet help using the Zoomaker CLIzoomaker --versionShow current Zoomaker versionzoomaker --no-symlinksDo not use symlinks for installing resources⚠️ Limitations on WindowsSymlinks are not widely supported on Windows, which limits the caching mechanism used by Zoomaker. To work around this limitation, you can disable symlinks by using the--no-symlinksflag with the install command:zoomakerinstall--no-symlinksThis will still use the cache directory for checking if files are already cached, but if not, they will be downloaded and duplicated directly to the installation directory, saving bandwidth but increasing disk usage. Alternatively, you can use theWindows Subsystem for Linux "WSL"(don't forget toenable developer mode) or run Zoomaker as an administrator to enable symlink support on Windows.🤗 Hugging Face Access TokenYou might be asked for aHugging Face Access Tokenduringzoomaker 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 commandhuggingface-cliis automatically shipped alongside zoomaker.huggingface-clilogin🙏 AcknowledgementsMost of the internal heavy lifting is done be thehuggingface_hub libraryby Hugging Face. Thanks!"Zoomaker Safari Hacker Cat" cover image by Alia Tasler, based on thisOpenMoji. Thanks!