Loading model checkpoints from safetensors and ckpt files
The complete model files are also called checkpoint data. If you read an article or document talking about downloading a checkpoint, they are talking about a Stable Diffusion model file.
There are many types of checkpoints, such as .ckpt files, safetensors files, and diffusers files:
.ckptis the most basic file format and is compatible with most Stable Diffusion models. However, they are also the most vulnerable to malicious attacks.safetensorsis a newer file format that is designed to be more secure than.ckptfiles. Thesafetensorsformat is better in terms of security, speed, and usability compared with.ckpt. Safetensors has several features to prevent code execution:- Restricted data types: Only specific data types, such as integers and tensors, are allowed to be stored. This eliminates the possibility of including code within the saved data.
- Hashing: Each chunk of data is hashed, and the hash is stored alongside...