Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Integration:  dvc git github
7595138d04
feat: added image to readme
1 year ago
3eea4037d1
dvc: experiment 1 generate one image
1 year ago
42b28bbba2
feat: added git
1 year ago
03ad5a88b0
feat: update
1 year ago
03ad5a88b0
feat: update
1 year ago
03ad5a88b0
feat: update
1 year ago
03ad5a88b0
feat: update
1 year ago
881c6e2791
fix: add accelerate
1 year ago
03ad5a88b0
feat: update
1 year ago
03ad5a88b0
feat: update
1 year ago
253288d8c5
feat: document dvc
1 year ago
7595138d04
feat: added image to readme
1 year ago
Storage Buckets
Data Pipeline
Legend
DVC Managed File
Git Managed File
Metric
Stage File
External File

Readme.md

You have to be logged in to leave a comment. Sign In

Stable Diffusion on CoreML Apple Silicon

https://machinelearning.apple.com/research/stable-diffusion-coreml-apple-silicon https://towardsdatascience.com/turn-vs-code-into-a-one-stop-shop-for-ml-experiments-49c97c47db27 https://github.com/huggingface/diffusers

Abstract

For simplicity I created a conda env which includes the apple dependencies for stable diffusion. Following the Setup Process is simpler in this way.

Setup Process

conda env create -f environment.yml
pip install -r requirements.txt
huggingface-cli login

DVC Experiment Tracking

dvc init

Conversion Process

python -m python_coreml_stable_diffusion.torch2coreml --convert-unet --convert-text-encoder --convert-vae-decoder --convert-safety-checker -o models

For convenience you could add this to dvc.yaml

  convert_model:
    cmd: python -m python_coreml_stable_diffusion.torch2coreml --convert-unet --convert-text-encoder --convert-vae-decoder --convert-safety-checker -o models 
    outs:
      - models

Usage

python -m python_coreml_stable_diffusion.pipeline --prompt "a photo of an astronaut riding a horse on mars" -i models -o data/processed --compute-unit ALL --seed 193

DVC Pipelines

Setting up a dvc remote + dvc.yaml with the above code is rather simple and can be done straight forward.

dvc repro

Misc

conda env export > environment.yml
Tip!

Press p or to see the previous file or, n or to see the next file

About

Experiments on Stablediffusion with CoreML on M1 Max

Collaborators 1

Comments

Loading...