stable-diffusion.cpp
stable-diffusion.cpp copied to clipboard
Image generation error on M1 and low image quanlity
I use SD_METAL=ON
to build sd.cpp
on m1. However, the generated image seems to be blured or tends to be in the cartoon-like style. This happens on all models (v2, SDXL, SDXL turbo). This problem only shows on m1. When change to other platforms, the image works fine. For making sure the model weight works, I made a comparison using sd.cpp on m1
, sd.cpp on ubuntu nvidia gpu
, pytorch model on nvidia gpu
with same prompt "a lovely cat" and default seed.
This problem sees worse when using SDXL series model ( SDXL base, SDXL turbo, etc) I noticed that I need to apply the fixed vae model. However, things not worked in an expected way.
I've tried to fix the problem. I guess there may have something to do with the ggml
itself. The very first thing to do is to upgrade ggml
version of sdcpp
. However, it seems that the quantize/dequantize policy of scheduling different operators changed. The logs shows as below:
I failed to upgrade it to latest ggml version.
What's more, it takes 4~5 seconds to run one iteration on m1, is this normal or expected way?