LaurentMazare / diffusers-rs

An implementation of the diffusers api in Rust
Apache License 2.0
539 stars 55 forks source link

Error: The system cannot find the file specified. (os error 2) #65

Closed eoriont closed 1 year ago

eoriont commented 1 year ago
     Running `target\debug\examples\stable-diffusion.exe --prompt "A very rusty robot holding a fire torch." --cpu all`
Cuda available: false
Cudnn available: false
MPS available: false
Running with prompt "A very rusty robot holding a fire torch.".
Building the Clip transformer.
Error: The system cannot find the file specified. (os error 2)
error: process didn't exit successfully: `target\debug\examples\stable-diffusion.exe --prompt "A very rusty robot holding a fire torch." --cpu all` (exit code: 1)

This is the output I get after running cargo run --example stable-diffusion --features clap -- --prompt "A rusty robot holding a fire torch." in cmd. I am on windows. I ran scripts/download_weights.sh in WSL and moved the /scripts/data directory to /data beforehand as well. I don't know what file it's referring to by "Error: The system cannot find the file specified. (os error 2)", help would be appreciated!

LaurentMazare commented 1 year ago

It's indeed annoying that the file does not get mentioned in the error message (which is a limitation of the Rust standard library). My guess is that it's the clip weight files based on the log, but it's the first one to be loaded. Note that this was recently switched to use safetensors by default, so maybe that's related. Could you check that your data directory contains pytorch_model.safetensors? If so could you also try overriding the clip weight file to point it at the appropriate place with --clip-weights path/to/clip-weights?

eoriont commented 1 year ago

Thanks for the response. I ended up manually logging the filenames, and found out that it expected the stable-diffusion-v2.1 filenames, whereas I had the v1.5 files downloaded. Added --sd-version v1-5 to the command, and it worked.