ggerganov / ggml

Tensor library for machine learning
MIT License
11.22k stars 1.04k forks source link

Suggestion: Stable Diffusion Model #4

Open jafri opened 2 years ago

jafri commented 2 years ago

Been following along with your speed increases on Whisper using ggml, which have been amazing

Would be interesting to see how stable diffusion runs on CPUs using ggml

Here are current benchmarks: image

Popular way to run SD: https://github.com/huggingface/diffusers

ggerganov commented 2 years ago

Yup, I've been thinking about it - the network seems a bit more complex compared to GPT and Whisper, but I think most of the building blocks are already available in ggml.

Last time I took a look at the python source, I got a bit lost because the model does not seem concentrated in one place as it is with the other models. For example, here I see 8 pipelines and I don't know which one is relevant and which not.

jafri commented 2 years ago

These 3 are the main pipelines

image

1: Text to Image (Most popular), give it a text prompt and it generates an image 2: Image to Image -> Example: give it an initial reference image and turn it into picasso style

  1. Inpainting image
jafri commented 2 years ago

This one is interesting too:

https://github.com/TheLastBen/fast-stable-diffusion

x-legion commented 1 year ago

Yup, I've been thinking about it - the network seems a bit more complex compared to GPT and Whisper, but I think most of the building blocks are already available in ggml.

Last time I took a look at the python source, I got a bit lost because the model does not seem concentrated in one place as it is with the other models. For example, here I see 8 pipelines and I don't know which one is relevant and which not.

IMG_20230428_143440.jpg

tikikun commented 1 year ago

hi thumb up for this

leejet commented 1 year ago

I've implemented Stable Diffusion using GGML. Welcome to try it out.

https://github.com/leejet/stable-diffusion.cpp

This is an example

./sd -m ../models/sd-v1-4-ggml-model-f16.bin -p "a lovely cat"

image