keijiro / UnityMLStableDiffusion

Core ML Stable Diffusion on Unity
Other
593 stars 51 forks source link

Stuck in Initialization for a Very Long Time on 2020 M1 MacBook Pro 8GB RAM #4

Closed andrewlaboy closed 1 year ago

andrewlaboy commented 1 year ago

Says it's loading resources in Webcam Test for about an hour now. White screen, webcam is working. I'll keep it running.

keijiro commented 1 year ago

8GB is pretty tight for Stable Diffusion, but according to Apple it can run the model. There are two things you can try:

enzyme69 commented 1 year ago

I can confirm - it's probably too slow or not running. I am testing using M1 iMac machine now, 8GB RAM CPU GPU. I am running TestStatic. It does not seem to produce or modify the image.

Do I change the Compute Units property by going into the code using Visual Studio? How to edit to original/compiled model files instead of split_einsum/compiled.

andrewlaboy commented 1 year ago

@keijiro I tried both of your suggestions and it didn't work. Screenshot 2023-03-27 at 7 04 04 PM Does this file setup look correct to you? This is the split_einsum/compiled folder renamed to StableDiffusion within StreamingAssets folder (packages folder isn't here, but I did try with packages folder just in case that was the issue, still nothing). I also tried it on a 2021 M1 Pro chipset 16GB RAM, same issue, which is making me think it's somehow my setup.

@enzyme69 I also got the security warning, you need to go to your Privacy & Security settings and click Allow Anyway every time it prompts. But if it prompts you to "Open" the app, click Cancel. Clicking Open will cause the Unity editor to crash every time you hit play. The Tester is a game object in your hierarchy, and Compute Units is a dropdown property of the Tester component on that object. Original / Compiled folder is the other folder in the repo you cloned.

keijiro commented 1 year ago

Your setup is correct. It should work.

Could you try Diffusers app?

https://apps.apple.com/us/app/diffusers/id1666309574?mt=12

It uses the same library to run the model. If it runs, this project should run too.

keijiro commented 1 year ago

I close this issue due to inactivity. Please reopen it for further problems.