apple / ml-stable-diffusion

Stable Diffusion with Core ML on Apple Silicon
MIT License
16.79k stars 935 forks source link

Can't use 2.0 after installation is done, I get the following output: #43

Open SeanFrohman opened 1 year ago

SeanFrohman commented 1 year ago

FileNotFoundError: text_encoder CoreML model doesn't exist at /Users/seanfrohman/Documents/AI_MODELS/Stable_Diffusion_version_CompVis_stable-diffusion-v1-4_text_encoder.mlpackage

So if I go ahead and install without using --model-version stabilityai/stable-diffusion-2-base

It works fine during install, but then I get the error above when prompting to use the 2.0 service.

If I leave --model-version blank, 1.4 installs into ~/Documents/AI_MODELS and it works with 1.4 no problem.

Anyone have any idea here? I am almost done, other than a few small issues with the prompt.

philipturner commented 1 year ago

I faced the same error when using v1.5 and a custom file URL as the model version.

I got the Swift CI version working right, but was trying to debug the constant 22-second overhead to "sample" images before passing them into the AI model. I hypothesized that using Swift instead of Python was the culprit, and switching to Python would remove the overhead.

philipturner commented 1 year ago

I removed the force-specified --model-version flag, and it automatically started re-downloaded the weights for (some unknown revision of Stable Diffusion?). I ended up quitting and staying on the Swift version. Still no idea why there's a 22-second overhead to "sample" that's larger than the 18-second throughput to "inference". I'm using a 32-core M1 Max.

I can make do with the total 40-second actual latency - it could be worse.

pcuenca commented 1 year ago

Hi @philipturner, that's one of the reasons why we wrote a standalone Swift app. The first generation takes a bit longer, but then each new image runs in ~10s in my M1 Max. I do get nil images sometimes (they appear as an exclamation mark in the output area), I need to investigate what could be the reason.