# From\_single\_file dtype issue

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffrom-single-file-dtype-issue%2F64480%3E%5C
**Category:** 🧨 Diffusers\
**Created:** [December 4, 2023, 7:05am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffrom-single-file-dtype-issue%2F64480 "2023-12-04T07:05:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fshewl](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/fshewl/32/21809_2.png) [@fshewl](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ffshewl)%5C
**Post date:** [December 4, 2023, 7:05am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffrom-single-file-dtype-issue%2F64480%2F1 "2023-12-04T07:05:31Z")

</div>

I am trying to read the pipeline from files on my filesystem:

```auto
base = StableDiffusionXLPipeline.from_single_file(
     "/path/to/sd_xl_base_1.0.safetensors", torch_dtype=torch.float16, variant="fp16", 
     use_safetensors=True
).to("cuda")

```

However, I kept getting the following error:

```auto
Traceback (most recent call last):
  File "/load_model.py", line 19, in <module>
    base = StableDiffusionXLPipeline.from_single_file(
  File "/opt/conda/lib/python3.8/site-packages/diffusers/loaders/single_file.py", line 261, in from_single_file
    pipe = download_from_original_stable_diffusion_ckpt(
  File "/opt/conda/lib/python3.8/site-packages/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py", line 1252, in download_from_original_stable_diffusion_ckpt
    checkpoint = safe_load(checkpoint_path_or_dict, device="cpu")
  File "/opt/conda/lib/python3.8/site-packages/safetensors/torch.py", line 310, in load_file
    result[k] = f.get_tensor(k)
RuntimeError: Viewing a tensor as a new dtype with a different number of bytes per element is not supported.

```

I have a L4 GPU and I tested runwayml/stable-diffusion-v1-5 using ComfyUI, but it doesn’t work with SDXL.

Appreciate any help in advance!
