viiika / Meissonic

We're back! Implementations of Meissonic developed by Community~If you feel it is helpful, plz consider giving a star❤️
https://viiika.github.io/Meissonic/
Apache License 2.0
256 stars 10 forks source link

Awesome #5

Closed nitinmukesh closed 4 weeks ago

nitinmukesh commented 1 month ago

Thanks for sharing with us, works pretty good.

I tried the fp16 version of models and made code changes in frompretained (wherever necessary by checking the fp16 version model in https://huggingface.co/MeissonFlow/Meissonic/tree/main) torch_dtype=torch.float16, variant="fp16",

But it comes with error. Anyway to use fp16 version as it will consume even less memory

Naugustogi commented 1 month ago

Just convert it to Safetensors and upload it to Huggingface. Its just an diffusers.

viiika commented 1 month ago

Apologies for the delayed response. A simple approach to using the fp16 model is to first load the fp32 model with from_pretrained, then convert it to fp16 using .half(). Afterward, you can assemble the components in the pipeline and move them to the appropriate device. Currently, directly loading the text encoder with variant="fp16" has some unresolved issues, which we’re working to address.

nitinmukesh commented 1 month ago

@viiika

Thanks for your response. Looking forward for the fix.

nitinmukesh commented 1 month ago

@viiika

Just asking as I was thinking of creating Gradio Ui for FP8, is FP16 fixed or is it .half().

Performance Benchmarks

Precision (Steps=64, Resolution=1024x1024) | Batch Size=1 (Avg. Time) | Memory Usage -- | -- | -- FP32 | 13.32s | 12GB FP16 | 12.35s | 9.5GB FP8 | 12.93s | 8.7GB
viiika commented 1 month ago

I'm sorry, but I don't fully understand your question. As of now, there are no updates regarding the fp16 issue.

nitinmukesh commented 1 month ago

Got it, thanks.

viiika commented 4 weeks ago
python inference_fp16.py

This script supports fp16 inference. Just set torch_dtype and do not set variant.