# Text\_encoder\_2, local model, not working

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftext-encoder-2-local-model-not-working%2F65580%3E%5C
**Category:** 🧨 Diffusers\
**Created:** [December 12, 2023, 10:29pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftext-encoder-2-local-model-not-working%2F65580 "2023-12-12T22:29:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SmithEdits](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/smithedits/32/22083_2.png) [@SmithEdits](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FSmithEdits)%5C
**Post date:** [December 12, 2023, 10:29pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftext-encoder-2-local-model-not-working%2F65580%2F1 "2023-12-12T22:29:50Z")

</div>

Hey. I am trying to use a specific model called “protovisionXLHighFidelity3D\_release0630Bakedvae.safetensors” locally, it downloads most things down, but it gives me this error:

Traceback (most recent call last):  
File “f:\Disk 2 (D)\CODING\PROJECTS\PYTHON\InstaLessReels\Diffusers.py”, line 9, in   
pipe = StableDiffusionPipeline.from\_single\_file(  
File “C:\Users\Alexa\AppData\Local\Programs\Python\Python310\lib\site-packages\huggingface\_hub\utils\_validators.py”, line 118, in \_inner\_fn  
return fn(\*args, \*\*kwargs)  
File “C:\Users\Alexa\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\loaders\single\_file.py”, line 261, in from\_single\_file  
pipe = download\_from\_original\_stable\_diffusion\_ckpt(  
File “C:\Users\Alexa\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\pipelines\stable\_diffusion\convert\_from\_ckpt.py”, line 1749, in download\_from\_original\_stable\_diffusion\_ckpt  
pipe = pipeline\_class(  
TypeError: StableDiffusionPipeline. **init** () got an unexpected keyword argument ‘text\_encoder\_2’

It looks like a missing text\_encoder\_2. Does any of you know what the solution to this is?

Here is my code:

```auto
import requests
from PIL import Image

from io import BytesIO

from diffusers import StableDiffusionPipeline

from diffusers import StableDiffusionUpscalePipeline

import torch

pipe = StableDiffusionPipeline.from_single_file(

"protovisionXLHighFidelity3D_release0630Bakedvae.safetensors", local_files_only=False, torch_dtype=torch.float16,safety_checker=None,requires_safety_checker=False

).to("cuda")

#Prompt

prompt = "charturnerv2, multiple views of the same character in the same outfit, a character turnaround of a woman wearing a black jacket and red shirt, best quality, intricate details."

image = pipe(prompt, height=720, width=408, num_inference_steps=24, guidance_scale=4).images[0]

image.save("Doesitwork.png")

print("Finished")

```

---

<div class="post-metadata">

**Author:** ![zzstar](https://avatars.discourse-cdn.com/v4/letter/z/258eb7/32.png) [@zzstar](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fzzstar)%5C
**Post date:** [May 25, 2024, 8:22am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftext-encoder-2-local-model-not-working%2F65580%2F2 "2024-05-25T08:22:03Z")

</div>

XL model should be loaded by StableDiffusionXLPipeline instead of StableDiffusionPipeline.

It’s been long since you posted the question, but I hope it would help to others having the same errors…
