diffusers
                                
                                
                                
                                    diffusers copied to clipboard
                            
                            
                            
                        [Proposal] Support saving to safetensors
Follow-up of https://github.com/huggingface/diffusers/pull/1357, and mimics Transformers https://github.com/huggingface/transformers/pull/20321/files#diff-82b93b530be62e40679876a764438660dedcd9cc9e33c2374ed21b14ebef5dba
The documentation is not available anymore as the PR was closed or merged.
@Narsil what do you think?
Great work @MatthieuBizien - thanks for the PR :-)
Hello @Narsil @patrickvonplaten 👋! Awesome to see this merged.
I am wondering if you have latency figures that compare loading a Stable Diffusion pipeline with and without safetensors on GPUs. Documentation elsewhere seems to suggest this should be faster. I am wondering if that's actually the case and, if so, how much faster that is.
It's really hard to answer in general. It will skip a cpu allocation and create objects directly on the gpu (using SAFETENSORS_FAST_GPU=1 environment variable). For cpu the loading part should be almost instant in a lot of cases. But it does depend on hardware.
Here is someone that had lots of success apparently.
https://gist.github.com/xrpgame/8f756f99b00b02697edcd5eec5202c59?permalink_comment_id=4388611#gistcomment-4388611
Some report barely a change.
Personally it's mostly 2x. Didn't see anyone observing it being slower though.
So I guess you're going to have to measure😉