ml-stable-diffusion

(★ 17,961)

Stable Diffusion with Core ML on Apple Silicon

File Explorer

  • .gitignore
  • ACKNOWLEDGEMENTS
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • LICENSE.md
  • Package.swift
  • README.md
  • requirements.txt
  • setup.py

# Installation Guide

python
Prerequisites

Setup Steps

pip install -r requirements.txt

Install Python dependency packages.

pip install .

Install the python coreml stable diffusion package.

Key Commands

pip install -r requirements.txt

Install the required Python packages for the project.

python -m pip install .

Install the python_coreml_stable_diffusion package locally.

Requires Apple Silicon Mac and macOS 13.1 or higher.

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Release Timeline

Command Glossary

Commands referenced in this DOCs, explained below.

🔍

conda activate

View Details ▼

Activate a conda environment.
See also: `conda deactivate`.

conda activate myenv

Activate an existing environment named `myenv`:

conda activate {{path/to/myenv}}

Activate an existing environment located at custom path:

conda activate --stack myenv

Stack `myenv` environment on top of a previous environment making libraries/commands/variables from both accessible:

🔍

conda create

View Details ▼

Create new conda environments.

conda create {{[-y|--yes]}} {{[-n|--name]}} py39 python=3.9 "numpy>=1.11" scipy

Create a new environment named `py39`, install Python 3.9, NumPy v1.11 or above in it, and the latest stable version of SciPy. Say yes to all confirmations:

conda create {{[-n|--name]}} myenv --file {{file1.yml}} --file {{file2.yml}}

Create a new environment named `myenv` and install packages listed in files:

conda create {{[-p|--prefix]}} {{path/to/myenv}}

Create a new environment at a custom path (i.e. prefix):

🔍

git clone

View Details ▼

Clone an existing repository.

git clone {{remote_repository_location}} {{path/to/directory}}

Clone an existing repository into a new directory (the default directory is the repository name):

git clone --recursive {{remote_repository_location}}

Clone an existing repository and its submodules:

git clone {{[-n|--no-checkout]}} {{remote_repository_location}}

Clone only the `.git` directory of an existing repository:

🔍

git lfs

View Details ▼

Work with large files in Git repositories.

git lfs install

Initialize Git LFS:

git lfs track '{{*.bin}}'

Track files that match a glob:

git config {{[-f|--file]}} .lfsconfig lfs.url {{lfs_endpoint_url}}

Change the Git LFS endpoint URL (useful if the LFS server is separate from the Git server):

🔍

git

View Details ▼

Distributed version control system.
Some subcommands such as `commit`, `add`, `branch`, `switch`, `push`, etc. have their own usage documentation.

git init

Create an empty Git repository:

git clone {{https://example.com/repo.git}}

Clone a remote Git repository from the internet:

git status

View the status of the local repository:

🔍

huggingface-cli

View Details ▼

This command is an alias of `hf`.

tldr hf

View documentation for the original command:

🔍

pip install

View Details ▼

Install Python packages.

pip install {{package1 package2 ...}}

Install one or more packages:

pip install {{package1 package2 ...}} {{[-U|--upgrade]}}

Upgrade all specified packages to the latest version, installing any that are not already present:

pip install {{package}}=={{version}}

Install a specific version of a package:

🔍

python

View Details ▼

Python language interpreter.

python

Start a REPL (interactive shell):

python {{path/to/file.py}}

Execute a specific Python file:

python -i {{path/to/file.py}}

Execute a specific Python file and start a REPL:

🔍

swift

View Details ▼

Create, run, and build Swift projects.

swift repl

Start a REPL (interactive shell):

swift {{file.swift}}

Execute a program:

swift package init

Start a new project with the package manager:

// repository documentation