You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OSError: CompVis/stable-diffusion-v1-4 does not appear to have a file named config.json. #302
Faced this issue myself. Your version of transformers package is probably old and does not recognise subfolder parameter.
Not related to this repo though.
Reacted by Giulio Starace, WangShengguang, SunWeiLin-Lynne, Antoni Kowalczuk, com-admin, Coco, Mikhail ILIN, Xin Qi Liu, Flavius Holerga, ElliotQi and 9 more
This can be internet issues, the below solved for me, run this in command line: HF_ENDPOINT=https://hf-mirror.com python # Or just add this before your xx.py and ignore the rest.
Then run the code to cache the model(change the model card name to what you need) text_encoder = CLIPTextModel.from_pretrained( 'CompVis/stable-diffusion-v1-4', subfolder="text_encoder", use_auth_token=True )
Now run you code.
Env:
I met this error when I use "stabilityai/stablelm-2-1_6b", because I build a folder with the path "stabilityai/stablelm-2-1_6b", which will guide transformers package to load model from the local folder. After removing the folder, the error disappears.
In my case, upgrading the transformers version did not resolve the issue, so I focused on the 'subfolder="unet"' parameter.
Originally, the code was written as : UNet2DConditionModel.from_pretrained(config["stable_diffusion_path"])
I modified it to: UNet2DConditionModel.from_pretrained(config["stable_diffusion_path"], subfolder="unet")
After this change, I cleared the Hugging Face cache using the following command: rm -rf ~/.cache/huggingface/hub
Then, I ran the original file I was trying to execute. This approach proved effective in resolving the issue.
I try to download the model using huggingface-cli in Windows powershell, and change coda as vae = AutoencoderKL.from_pretrained(path, subfolder="vae", use_safetensors=True), it is successful. my env is transformers==4.49.0
noise_scheduler = DDPMScheduler.from_pretrained(
args.pretrained_model_name_or_path, subfolder="scheduler"
)
then
OSError: CompVis/stable-diffusion-v1-4 does not appear to have a file named scheduler_config.json.
Activity
apsifly commentedon Sep 24, 2022
Faced this issue myself. Your version of
transformerspackage is probably old and does not recognisesubfolderparameter.Not related to this repo though.
successbyfailure commentedon Sep 27, 2022
+1
Following the guide https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion I also run into that error.
Im using transformers from pip... so.... its waiting till they release a new version?
apsifly commentedon Sep 27, 2022
already fixed at least in 4.22.1
successbyfailure commentedon Sep 28, 2022
You're right!
The conda env has transformers version pinned to 4.19.2. Updated and solved :)
gregedout commentedon Oct 12, 2022
so what should we do if we face this error?
successbyfailure commentedon Oct 12, 2022
Say not today and upgrade transformers.
For me the case was that I had the environment already setup and transformers was pinned to 4.19 in the requirements.txt
So I just edited the requirements.txt and set transformers to at least 4.22.1 then run pip install -r requirements.txt, that did the trick for me
sjkoelle commentedon Apr 3, 2023
fwiw im getting this error with transformers 4.27.1
squewel commentedon Apr 8, 2023
Also having issues on the latest version
MrHup commentedon May 27, 2023
Still happening as of 27 May with latest transformers version.
wyf-gh commentedon Dec 14, 2023
Also having the same issues on transformers==4.36.0 cuda==11.6 pytorch==1.12.0. Does anyone have a solution?
VikingMew commentedon Jan 28, 2024
meet in 4.37.1
Value-Jack commentedon Mar 11, 2024
meet too! 4.37.1 do you solve this problem?
DetoitBecomeHuman commentedon Mar 19, 2024
me too in 4.31.
mlmlh commentedon Mar 24, 2024
same for 4.39.1
BingliangLi commentedon Apr 8, 2024
This can be internet issues, the below solved for me, run this in command line:
HF_ENDPOINT=https://hf-mirror.com python# Or just add this before your xx.py and ignore the rest.Then run the code to cache the model(change the model card name to what you need)
text_encoder = CLIPTextModel.from_pretrained( 'CompVis/stable-diffusion-v1-4', subfolder="text_encoder", use_auth_token=True )Now run you code.
Env:
Forence1999 commentedon May 27, 2024
I met this error when I use "stabilityai/stablelm-2-1_6b", because I build a folder with the path "stabilityai/stablelm-2-1_6b", which will guide transformers package to load model from the local folder. After removing the folder, the error disappears.
jsujeon commentedon Jul 11, 2024
In my case, upgrading the transformers version did not resolve the issue, so I focused on the 'subfolder="unet"' parameter.
Originally, the code was written as :
UNet2DConditionModel.from_pretrained(config["stable_diffusion_path"])I modified it to:
UNet2DConditionModel.from_pretrained(config["stable_diffusion_path"], subfolder="unet")After this change, I cleared the Hugging Face cache using the following command:
rm -rf ~/.cache/huggingface/hubThen, I ran the original file I was trying to execute. This approach proved effective in resolving the issue.
adityapandey2811 commentedon Sep 12, 2024
For me, I updated:
UNet2DConditionModel.from_pretrained(model_id)to
UNet2DConditionModel.from_pretrained(model_id, subfolder="unet")and
DDPMScheduler.from_pretrained(model_id)to
DDPMScheduler.from_pretrained(model_id, subfolder="scheduler")This worked for me.
XinyiZheng commentedon Mar 7, 2025
I try to download the model using huggingface-cli in Windows powershell, and change coda as
vae = AutoencoderKL.from_pretrained(path, subfolder="vae", use_safetensors=True), it is successful. my env is transformers==4.49.0wujiang0156 commentedon May 8, 2025
noise_scheduler = DDPMScheduler.from_pretrained(
args.pretrained_model_name_or_path, subfolder="scheduler"
)
then
OSError: CompVis/stable-diffusion-v1-4 does not appear to have a file named scheduler_config.json.
is anyone solved it?