Safetensors files store tensors. Safetensors files do not allow code execution. Different Stable Diffusion versions load models from different directories. To use a SAFETENSOR file with Stable Diffusion, you must place it in the directory your version loads models from. Refer to your Stable Diffusion’s documentation if you don’t know where to place your SAFETENSOR file.
You can load only part of the tensors from a safetensors file. This is interesting when running on multiple GPU. Safetensors files are fast.
Safetensors files are a new format for storing tensors safely and fast. Safetensors files are incapable of containing malicious code. This makes them more secure than formats like pickle used for storing PyTorch model weights.
Safetensors files differ from checkpoint and LoRA model file extensions like .ckpt and .safetensors in safety, speed and convenience. We’ll talk about why you should bother with these formats.
The safetensors R package supports reading safetensors files. Writing files is not yet supported. You can install the package from CRAN or the GitHub development version.
A file format stores tensors securely without allowing code execution. ‘Safetensors’ enables compatibility across languages and frameworks. This makes it ideal for storing machine learning model weights.
You can convert Stable Diffusion checkpoint files to .safetensors format using Python libraries like torch and safetensors. Tools like “Safe & Stable” offer a graphical user interface to simplify .ckpt to .safetensors conversion.
Safetensors are safer than standard .ckpt files in Stable Diffusion. Safetensors are designed to prevent malicious code being hidden inside them. Stable Diffusion team created them to address concerns about .ckpt files. Safetensors convert .ckpt files to a new format incompatible with Python, so no Python code can run.
The safetensors R package supports reading safetensors files securely and fast. Writing files is not yet supported. You can install from CRAN or GitHub. Safetensors enable cross language and framework compatibility for storing machine learning model weights.