leejet

Results 87 comments of leejet

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](https://github.com/ggerganov/ggml/assets/31925346/55f5c61f-11ba-4639-aacc-c73c7e8fddfa)

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](https://github.com/ggerganov/ggml/assets/31925346/55f5c61f-11ba-4639-aacc-c73c7e8fddfa)

The ggml_group_norm is not calculated over the first 2 dimensions, but rather splits ne2 (which is equivalent to num_channels in PyTorch) into n_groups (equivalent to num_groups in PyTorch) groups and...

Here is a simple schematic diagram: ne0 => W, ne1 => H, ne2 => C, ne3 => N. ![norm](https://gaoxiangluo.github.io/2021/08/01/Group-Norm-Batch-Norm-Instance-Norm-which-is-better/figure6.png)

I just updated the ggml of stable-diffusion.cpp to the latest commit. It works great, the image generation speed on the CPU has improved, and I haven't encountered any issues.

The issue arose due to my mistaken merge of https://github.com/leejet/stable-diffusion.cpp/pull/233. I believe it has been fixed in the latest commit.

@grauho In Release mode, assertions are disabled during compilation, which is likely why you couldn't reproduce the error. I believe most people compile in Release mode, so they wouldn't encounter...

> @leejet I believe that is done by adding noise only to the white part of the latent image, and in the decoder, keeping the pixels of the black part...

> @leejet I think we should first solve that problem before considering adding the inpainting feature. > > Inpainting models require a latent image with 9 input channels, 4 for...

This seems to be an issue with the implementation of the ggml Metal backend. You can try removing the corresponding assets to see if the issue persists.