.SAFETENSORS File Extension
Stable Diffusion Model
Developer | Hugging Face |
Popularity |
4.0 | 5 Votes |
What is a SAFETENSORS file?
A SAFETENSORS file is a machine learning model created for use with Stable Diffusion, a text-to-image generator. It contains algorithms that Stable Diffusion uses to produce images. SAFETENSORS files are similar to .CKPT files, but considered safer to use because they cannot contain malicious code.
More Information
Stable Diffusion is an AI-based image generation app developed by Stability AI. It allows users to input text and generate (or edit) a resulting image.
To create images, Stable Diffusion uses a machine learning model that interprets the text a user has entered and translates it into an image. Users can create their own models for use with Stable Diffusion or download existing models from the internet. Many of these models are saved in the SAFETENSORS format, developed by the Hugging Face community (comprised of AI app enthusiasts and developers).
Primarily, Hugging Face developed the SAFETENSORS format to fix vulnerabilities in the CKPT model format. CKPT files can contain malicious Python code that a user might accidentally execute while using those models; SAFETENSOR files cannot. Additionally, Stable Diffusion can load and switch between SAFETENSOR models more quickly than it can CKPT models.
Where to get SAFETENSORS files
You can download many SAFETENSORS files from the Models section of Hugging Face's website.
How to open a SAFETENSORS file
To use a SAFETENSOR file with Stable Diffusion, you must place it in the directory from which your version of Stable Diffusion loads models. However, different variants of Stable Diffusion (such as AUTOMATIC1111 Stable Diffusion Web UI and NMKD Stable Diffusion GUI) load models from different directories. If you don't know where to place your SAFETENSOR file, refer to your version of Stable Diffusion's documentation.
Then, load your SAFETENSOR file as you would any Stable Diffusion model, from within the app itself.