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:
.ckpt
is the most basic file format and is compatible with most Stable Diffusion models. However, they are also the most vulnerable to malicious attacks.safetensors
is a newer file format that is designed to be more secure than.ckpt
files. Thesafetensors
format 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...