basujindal / stable-diffusion

Optimized Stable Diffusion modified to run on lower GPU VRAM
Other
3.14k stars 467 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'models/ldm/stable-diffusion-v1/model.ckpt' #224

Open Night-Chan opened 1 year ago

Night-Chan commented 1 year ago

Using img2img within miniconda raises the error:

Traceback (most recent call last): File "optimizedSD/optimized_img2img.py", line 191, in sd = load_model_from_config(f"{ckpt}") File "optimizedSD/optimized_img2img.py", line 30, in load_model_from_config pl_sd = torch.load(ckpt, map_location="cpu") File "~~\miniconda3\envs\ldm\lib\site-packages\torch\serialization.py", line 699, in load with _open_file_like(f, 'rb') as opened_file: File "~~\miniconda3\envs\ldm\lib\site-packages\torch\serialization.py", line 231, in _open_file_like return _open_file(name_or_buffer, mode) File "~~\miniconda3\envs\ldm\lib\site-packages\torch\serialization.py", line 212, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'models/ldm/stable-diffusion-v1/model.ckpt'

User directory replaced with ~~ A similar error comes up when using a 32 bit version of miniconda.

Might possibly be a configuration issue on my end, it could be I missed the installation of a dependancy. I could replicate this error on a different system too, but havent found the reason for it.

doommate commented 1 year ago

You are missing the "model.ckpt" file.. I'm not sure if this (optimized) version uses the same one, but I got mine here: https://huggingface.co/CompVis/stable-diffusion#model-access

Select "stable-diffusion-v-1-4-original" and then "sd-v1-4.ckpt". The file is around 5GB. After it's downloaded, move it to location "models/ldm/stable-diffusion-v1/" and rename it into model.cpkt