Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

img2img.py FileNotFoundError: [Errno 2] #189

Open
ThreeTwoBravo opened this issue Sep 4, 2022 · 9 comments
Open

img2img.py FileNotFoundError: [Errno 2] #189

ThreeTwoBravo opened this issue Sep 4, 2022 · 9 comments

Comments

@ThreeTwoBravo
Copy link

I'm a Linux noob so I've more than likely for my path wrong, anyone able to help on this? I have a "inputs" sub folder/directory in my stable diffusion directory and using this to point to the img:

python scripts/img2img.py --prompt "highly detailed,charcoal portrait" --init-img inputs/00030.png --strength 0.8

but get this error:

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

@ryanirl
Copy link

ryanirl commented Sep 5, 2022

It seems the problem here is not that you are referencing to images in an "inputs" folder, but that you have not properly installed the model weights. In the stable-diffusion README, they explain that after your obtain the stable-diffusion-v1-*-original weights you must link them to the models/ldm/stable-diffusion-v1/ folder under the name model.ckpt. For more information on how to properly install the weights, see the reference sampling script section of the README.

@ThreeTwoBravo
Copy link
Author

@ryanirl thanks for the reply. Bit confused here, I am able to run txt2img outputs so pretty sure I have all the weights. I already have models/ldm/stable-diffusion-v1/ just no model.ckpt

Do navigate to stable-diffusion-v1/ in the terminal and then run ln -s <path/to/model.ckpt> models/ldm/stable-diffusion-v1/model.ckpt ?

@ThreeTwoBravo
Copy link
Author

@ryanirl just got this working. I did have the weights, just had rename it from sd-v1-4.ckpt to model.ckpt and move to stable-diffusion-v1. Thanks again for the reply.

@Quasimondo
Copy link

One little tip: when creating the symbolic link you have to use an absolute path to the sd-v1-4.ckpt and not a relative one - I made that mistake at first.

@nergdron
Copy link

nergdron commented Sep 9, 2022

@Quasimondo just ran into that! @CompVis I think that should definitely be documented, since it isn't clear.

@navieko
Copy link

navieko commented Sep 11, 2022

I've got the same issue, however I'd already downloaded the sd-v1-4.ckpt, renamed it to model.ckpt, and have moved it to the models/ldm/stable-diffusion-v1 folder which I'd created. However I'm still getting the "FileNotFoundError: [Errno 2] No such file or directory: 'models/ldm/stable-diffusion-v1/model.ckpt'" error each time I try running the image. Any ideas?

@Quasimondo
Copy link

You could add a print(os.path.abspath(ckpt)) before the load model line and see if it tries to load it from a different path.

@celikmustafa89
Copy link

I could not find the weights we are they?
There is no file like sd-v1-4.ckpt, or there is no drive link for the model.
Am I missing something??

@richard523
Copy link

richard523 commented Dec 12, 2022

If you're looking at this tutorial:
https://www.howtogeek.com/830179/how-to-run-stable-diffusion-on-your-pc-to-generate-ai-images/

Then you missed the step of adding the model to the directory that you created. Make sure you change the name of the file to "model.ckpt"

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants