Stable-Diffusion-NCNN icon indicating copy to clipboard operation
Stable-Diffusion-NCNN copied to clipboard

@fenwang's 7 GB to 5.5 GB (512x512)

Open ClashSAN opened this issue 1 year ago • 3 comments

https://github.com/fengwang/Stable-Diffusion-NCNN image hi, It looked like there was this memory optimization applicable to 8gb laptops (no swap requirement)

Is this also applicable to android mobile, specifically? You have mentioned a while ago the f16 512x512 version working on your 12gb ram android. Also, is the 256x256 model a fixed shape, and is a quantized model?

ClashSAN avatar Mar 22 '23 08:03 ClashSAN

For some of the metrices, I have not updated them for some time and suggest you actually test them. All the models I have used are fp16, not quantitative one.

EdVince avatar Mar 22 '23 08:03 EdVince

thanks. my bad, the models were obviously labeled. I used your diffusers conversion repository successfully, may I ask if the current vae decoder provided via cloud drive is the separate nai vae, or the one built-in (regular SD)? The int8 and/or uint8 quantization process is easy enough with onnx, but I don't know how to do this with .pt (pnnx)

Your ncnn implementation is currently as fast as the openvino implementation, and supports multiple sizes. I am interested in quantization because you have an apk release that supports 6gb currently, and 4gb may be supported if the quantized model is used, or maybe some low ram optimization. I'm not sure.

ClashSAN avatar Mar 23 '23 21:03 ClashSAN

But considering that diffusion is a noisy computational process, I don't think quantifying such data will give a good result.

EdVince avatar Mar 24 '23 05:03 EdVince