# Safetensors model file

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsafetensors-model-file%2F64160%3E%5C
**Category:** Beginners\
**Created:** [November 30, 2023, 8:56pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsafetensors-model-file%2F64160 "2023-11-30T20:56:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fronklens](https://avatars.discourse-cdn.com/v4/letter/f/f17d59/32.png) [@Fronklens](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FFronklens)%5C
**Post date:** [November 30, 2023, 8:56pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsafetensors-model-file%2F64160%2F1 "2023-11-30T20:56:31Z")

</div>

Hello! Who can explain how to take a safetensors file (for example, from civitai) and integrate it as a model for diffusers? The `from_single_file()` method does not work on any version of diffusers (conversion error). It is also completely unclear how to transfer this safetensors file to Hugging Face in a format understandable to diffusers to load it via the `from_pretrained` method.

---

<div class="post-metadata">

**Author:** ![Fronklens](https://avatars.discourse-cdn.com/v4/letter/f/f17d59/32.png) [@Fronklens](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FFronklens)%5C
**Post date:** [November 30, 2023, 9:06pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsafetensors-model-file%2F64160%2F2 "2023-11-30T21:06:17Z")

</div>

Convert error example:

```auto
Traceback (most recent call last):
  File "/src/scripts/download-weights", line 25, in <module>
    pipe = StableDiffusionPipeline.from_single_file("./zhanche-v100.safetensors", use_safetensors=True, cache_dir=MODEL_CACHE)
  File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/diffusers/loaders/single_file.py", line 261, in from_single_file
    pipe = download_from_original_stable_diffusion_ckpt(
  File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py", line 1436, in download_from_original_stable_diffusion_ckpt
    converted_unet_checkpoint = convert_ldm_unet_checkpoint(
  File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py", line 426, in convert_ldm_unet_checkpoint
    new_checkpoint["time_embedding.linear_1.weight"] = unet_state_dict["time_embed.0.weight"]
KeyError: 'time_embed.0.weight'
ⅹ exit status 1

```
