madebyollin / maple-diffusion

Stable Diffusion inference on iOS / macOS using MPSGraph

Home Page:https://madebyoll.in/posts/maple_diffusion/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fatal error: Unexpectedly found nil while unwrapping an Optional value

alelordelo opened this issue · comments

Thanks for sharing this, absolutely amazing!

Tried running on:
MacBook Air M1 16GB
MacOS Ventura 13.0 (22A380)
Xcode 14.0.1 (14A400)

And got this error:
maple_diffusion/MapleDiffusion.swift:18: Fatal error: Unexpectedly found nil while unwrapping an Optional value
2022-10-31 16:33:10.431161+0100 maple-diffusion[91931:1445876] maple_diffusion/MapleDiffusion.swift:18: Fatal error: Unexpectedly found nil while unwrapping an Optional value
(lldb)

Screenshot 2022-10-31 at 16 38 28

Seems like the files where generated on the bin folder:
Screenshot 2022-10-31 at 16 34 14

Any idea what could be wrong?

Cheers from Stockholm!

Additional info...

The .ckpt file is a model created with StableDiffusion DreamBooth.
Would this be different than StableDiffusion?

Update...

Doing this hack, fixed my issue:
#18

Probably because it added the model files missed... But could this extra files somehow Messe my model inference?

I just pushed the missing file (alphas_cumprod.bin) directly to the repo, and I think Dreambooth models should load without crashing now. AFAIK all Stable Diffusion-derived models use the same alphas_cumprod, so it should be safe to include for everyone.

I tested converting moDi-v1-pruned.ckpt and it seems to load now.
image