Zabriskije / SD-to-CoreML

Shell script to convert Stable Diffusion 1.5 models to Core ML
GNU General Public License v3.0
51 stars 6 forks source link

FileNotFoundError #2

Closed Ka1der closed 8 months ago

Ka1der commented 8 months ago

Hi. The script doesn't work. Gives an error message. Can't find the model.

Traceback (most recent call last): File "convert_original_stable_diffusion_to_diffusers.py", line 160, in pipe = download_from_original_stable_diffusion_ckpt( File "/Users/kaider/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py", line 1252, in download_from_original_stable_diffusion_ckpt checkpoint = safe_load(checkpoint_path_or_dict, device="cpu") File "/Users/kaider/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/safetensors/torch.py", line 308, in load_file with safe_open(filename, framework="pt", device=device) as f: FileNotFoundError: No such file or directory: "icbinpICantBelieveIts_lcm.safetensors"

Снимок экрана 2023-12-24 в 19 58 21
Zabriskije commented 8 months ago

Have you edited the sd-to-coreml.sh file to match your custom paths?

# If Miniconda has been installed in a different folder from your home one, change "YOUR-PATH-HERE" with your custom path. Otherwise, simply delete it
source ~/YOUR-PATH-HERE/miniconda3/etc/profile.d/conda.sh
conda activate coreml_stable_diffusion

# Change "YOUR-PATH-HERE" with your Diffusers script and model's path
cd ~/YOUR-PATH-HERE

Also, I don't see the convert_original_stable_diffusion_to_diffusers.py script in the model's folder.

Ka1der commented 8 months ago

Yes. Paths edited.

Снимок экрана 2023-12-24 в 21 41 50

I put the file in a folder. But it did not help

Снимок экрана 2023-12-24 в 22 02 29 Снимок экрана 2023-12-24 в 22 02 14
Zabriskije commented 8 months ago

The specified path is Users/kaider/miniconda3/pkgs but the folder in the screenshot is named SD-to-CoreML-1.3a, so perhaps the problem could be this? The path present in the script should be the same as the folder that contains your model, script, and Python file.

Ka1der commented 8 months ago

I put the file in the folder with the script, pointed to the file path and it helped. Thank you. Safetensors has been recoded to Diffusers. But when converting to splineinsum, the new file is again missing.

Where can I get this file? Should I put it in /Users/kaider/miniconda3/envs/coreml_stable_diffusion/bin/ ?

Снимок экрана 2023-12-25 в 20 06 42
Zabriskije commented 8 months ago

Try typing in the terminal conda activate coreml_stable_diffusion, then pip install python_coreml_stable_diffusion.

Ka1der commented 8 months ago

Some problem with version.... python? I have 3.8.18

Снимок экрана 2023-12-25 в 20 56 34
Zabriskije commented 8 months ago

I don't know exactly what can cause this. Could you try deleting the Conda env (conda env remove --name coreml_stable_diffusion), the ml-stable-diffusion repo, and install it again? Basically from point 5 of the Prerequisites.

Ka1der commented 8 months ago

That helped! I removed the Conda command (conda env remove --name coreml_stable_diffusion) and followed all the steps in the Prerequisites section again. I was able to convert safetensors -> diffusers -> split-einsum (mlmodels). Thank you!

Zabriskije commented 8 months ago

You're welcome. Sometimes it happens, so save that command somewhere ;)