madebyollin / maple-diffusion

Stable Diffusion inference on iOS / macOS using MPSGraph
https://madebyoll.in/posts/maple_diffusion/
MIT License
799 stars 51 forks source link

in real device crashed #25

Open jiangdi0924 opened 1 year ago

jiangdi0924 commented 1 year ago

maple-diffusion is terrific repo,thanks to the author 👍.Now i can run it on simulator,but in real device I have encountered some issue.

Version & Device number

Sign & Capabilities

Cmmond Error 2022-11-16 22:59:47.788875+0800 maple-diffusion[2120:173361] Metal GPU Frame Capture Enabled 2022-11-16 22:59:47.790188+0800 maple-diffusion[2120:173361] Metal API Validation Enabled 2022-11-16 22:59:52.181475+0800 maple-diffusion[2120:173550] [ServicesDaemonManager] interruptionHandler is called. -[FontServicesDaemonManager connection]_block_invoke libc++abi: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc terminating with uncaught exception of type std::bad_alloc: std::bad_alloc (lldb)

image

madebyollin commented 1 year ago

Ah, thanks for testing! I think the iPhone 13 only has 4GB of RAM, so I guess we have found the lower limit (MD uses around 3.5GB iirc, but I guess the OS doesn't let us use that much when the phone only has 4). I've updated the README to reflect this result.

For iPhone 13, you are definitely better off with liuliu's app, which gets down to 2GB RAM by splitting up the graph even more and replacing some memory-heavy parts with lower-level MPS operations.

jiangdi0924 commented 1 year ago

❤️Thanks for the reply , I would like to integrate it with other features. For now I can consider developing the macOS version first.