A .safetensors file is a model-weight file: it stores the numbers (tensors) of a Stable Diffusion checkpoint, LoRA, VAE, or other component, in a format Hugging Face designed so that loading it cannot run arbitrary code the way pickle-based .ckpt files can. You do not open it like a document. You put it in the right models folder of a tool such as ComfyUI or AUTOMATIC1111, and that tool loads it.
The short answer
Safetensors is a serialization format for named tensors: multidimensional arrays containing model weights and related numeric data. In Stable Diffusion communities, the same .safetensors extension may hold a full checkpoint, a LoRA, a VAE, a text encoder, or another component. The extension describes the container, not the role of the file.
The format was designed as a fast tensor store that avoids the executable object-deserialization behavior of pickle-based formats. That is a meaningful security improvement, but it does not turn every downloaded model into trusted software or guarantee that the model card is accurate.
Can you open a .safetensors file?
Not in the usual sense. Double-clicking it will not show anything useful, because the file is mostly raw tensor data. The Safetensors documentation lays out the structure: the first 8 bytes give the size of a JSON header, the header lists each tensor's name, data type, shape, and byte offsets (plus an optional __metadata__ map of strings), and the rest of the file is the data.
To use the file, load it in an app that supports it. To inspect it, the maintainers' Python library (pip install safetensors) reads it with safe_open and get_tensor, so you can list the tensor names without loading the whole model. The repository also notes that the header is limited to 100MB to prevent parsing extremely large JSON.
Where to put a .safetensors file
It depends on the tool and on what the file is. ComfyUI's documentation says to put model files under ComfyUI/models/ in the subfolder for that type, for example checkpoints, loras, or vae. The AUTOMATIC1111 web UI wiki puts checkpoints in models/Stable-diffusion and LoRA files (.pt or .safetensors) in models/Lora.
So read the model page first and confirm whether you downloaded a checkpoint, a LoRA, or a VAE. A LoRA in the checkpoints folder will not load as a checkpoint, and renaming it does not change what it is. ComfyUI can also share one models folder with other UIs through extra_model_paths.yaml, which its documentation says to restart after editing. A shared ComfyUI workflow stores model file names, not the files, so keep the exact name; how to share a ComfyUI workflow without errors covers what to send with it.
Safetensors vs .ckpt
Both can hold the same model weights. The difference is how they load. The Safetensors repository describes pickle, the format behind PyTorch .ckpt files, as unsafe because it can run arbitrary code, and says the main reason Safetensors exists is to remove the need for pickle. Its comparison table also lists zero-copy and lazy loading, so a tool can read only the tensors it needs.
When a model page offers both, choose the .safetensors file. Many projects already use the format, including AUTOMATIC1111, ComfyUI, diffusers, and InvokeAI, according to the Safetensors documentation.
PhoneDiffusion generates on-device on iPhone or iPad, with optional cloud models. Download on the App Store →
What is inside the file
A Safetensors file begins with metadata describing tensor names, data types, shapes, and byte offsets, followed by the tensor data. A compatible loader can inspect that structure and read the arrays without importing an arbitrary Python object graph.
Optional metadata may identify a format or training details, but metadata is not mandatory proof of the base-model family. Two files can share the same extension and still target entirely different architectures or pipeline components.
Why it is safer, and what it does not solve
Pickle can reconstruct Python objects and may execute code during unsafe loading. Safetensors restricts the file to tensor data and a small header, removing that particular object-execution path. This is why many model repositories prefer it for weight distribution.
It does not verify the publisher’s identity, scan every surrounding download, establish a license, prevent a misleading model description, or guarantee acceptable outputs. A repository can include scripts, custom nodes, installers, or other files beside a safe tensor file. Evaluate the complete download and workflow.
How to identify what a file is for
Start with the model card or repository, not the filename. Record whether the file is a checkpoint, LoRA, VAE, encoder, or another component; the expected architecture; the version; and the loader instructions. File size can be a clue, but it is not a reliable classifier because precision, quantization, architecture, and included components vary.
When a tool reports missing or unexpected keys, stop and verify the selected component and model family. Renaming a file or placing it in another folder does not convert it into the required architecture.
A careful download checklist
Use a reputable repository, read the model card and license, select the exact documented file, preserve its version or commit, and compare a published checksum when one is available. Keep model files separate from scripts and custom nodes so each receives the right level of review.
If the repository requires a custom loader, installer, or node, inspect that code and its permissions independently. The .safetensors extension only describes the tensor file; it does not vouch for another executable component.
PhoneDiffusion availability and article scope
PhoneDiffusion installs curated model packs prepared for its on-device Core ML runtime; its optional cloud models run on PhoneDiffusion’s AI provider and are not downloaded as files. It does not provide a general production importer for arbitrary .safetensors checkpoints, LoRAs, VAEs, or text encoders downloaded from model repositories.
A desktop Safetensors file therefore should not be assumed to work on iPhone simply because its contents are model weights. Conversion, architecture support, memory fit, and app integration are separate requirements.
Field notes
- Safetensors is a container for tensor data; it does not identify whether the file is a checkpoint, LoRA, VAE, or another component.
- The format avoids pickle-style object execution, but provenance, licensing, compatibility, and adjacent code still require review.
- Use the model card and exact architecture requirements rather than guessing from the extension or file size.
- You do not open a .safetensors file directly: put it in the matching models folder (checkpoints, loras, vae) and let the tool load it.
Try it on your phone
- Open the source repository and identify the file’s intended component and base-model family.
- Read the model card, version notes, loader instructions, and license.
- Select the exact documented file, preferring .safetensors over .ckpt, and verify a checksum when the publisher provides one.
- Put it in the matching folder: ComfyUI/models/checkpoints, loras, or vae; or models/Stable-diffusion and models/Lora in AUTOMATIC1111.
- Review any scripts, installers, or custom nodes separately from the tensor file.
- Record the repository, version, filename, and compatible runtime before using it.
Sources and verification
Primary and maintainer documentation checked for this guide. Product-specific details were reviewed against the current PhoneDiffusion scope.
- Hugging Face: Safetensors documentationMaintainer documentation for the tensor-only file format, its layout, supported frameworks, and loading APIs.
- Hugging Face: Safetensors reference implementationSource repository and format rationale for storing tensors without the executable object-loading behavior associated with pickle.
- ComfyUI documentation: ModelsOfficial guide to the ComfyUI/models subfolders (checkpoints, loras, vae and others) and to sharing model folders with extra_model_paths.yaml.
- AUTOMATIC1111 Stable Diffusion web UI: Features wiki (model folders)Maintainer wiki naming models/Stable-diffusion for checkpoints and models/Lora for LoRA files (.pt, .safetensors).