-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MacOS Sonoma 14.4 update breaks GPU acceleration on Apple Silicon #2992
Comments
Webui Forge works fine, does not seem slower either. No difference either if I use Torch 2.1.2 or the latest 2.2.1. I am on the latest 14.4 and did not have issues in beta either. So I decided to install Comfy with the help of You are right all it generates is blue solid pictures. InvokeAi works fine too so not sure why Comfy does not. |
I just did a clean install of everything related to ComfyUI and it's still broken. Didn't imagine MacOS update would be the culprit. |
If you search for "sonoma 14.4 stable diffusion" you will find a number of different reports of issues with the beta. However none of them seems to line up with the blue square output behavior with the release version. |
Seeing that InvokeAI works fine and it uses venv, I decided to use it for ComfyUI as well. I've used it with Python3.11 and only for installing ComfyUI requirements and torch. |
Honestly can't see how that would be relevant, if that fixed anything I would assume it was a version-specific incompatibility between 14.4 and a pytorch nightly or something (which was specified in the requirements.txt you used to build the venv but not user-wide, or something like that). My best guess is that one of the modules used an undocumented approach to optimizing something which was (without release notes) broken by Apple - so this is likely in a dependency like torch, but which one is anyone's guess at this point. This issue in Automatic1111 might be relevant, but the behavior isn't the same (glitchy, not solid cyan). |
That's all I could conjure from my very limited python knowledge.
Switching to different samplers has indeed fixed a part of the issue. The initial generation is glitchy but iterative upscale improves it quite a bit. |
Which checkpoint? Using SDXL-Lightning here which requires Euler sampler, the output with others is always garbage. |
So far I've only tried using SDXL 1.0 (aamXLAnimeMix_v10) with dpmpp_2m_sde_gpu. The final output still has artefacts; I've been noticing them even before the OS update, though to a lesser extent. |
I did a fresh install of comfyUI without any modification or custom_node and confirms that the workflows worked before the macOS upgrade stops working. The command line argument |
confirms that |
After updating Sonoma to 14.4 and some testing, ComfyUI seems to work with only SDE samplers. Also ControlNet nodes not working. |
Try with the --cpu flag and make sure --force-fp16 is not set. That fixed ControlNet for me. |
Confirming that some SDE samplers do work. dmpp_sde and dmpp_sde_gpu are outputting clean results. dmpp2_sde, dmpp2_sde_gpu, dmpp3_sde, and dmpp3_sde_gpu will output, but it's not pretty. |
From a very handmade and casual test, it seems to me that it's not a matter of a single sampler or a single scheduler but the combination of both: some combinations work, other don't. My results (M1 8GB): Work (as expected):
Don't work (blurry and weird):
|
+1 |
I temporarily downgraded torchvision to version 0.16.2 to resolve the issue. Below is my conda env environment.yml, and I am using Python 3.10.
Host:
|
This works for me too and solves the blurry images with SD 1.5 models (thanks!). Half of the problem is now gone. I still have insanely high generation times (over 100s/it) with SDXL models though, as if – in this case too – there’s no GPU acceleration (speed is the same as with che --cpu flag, more or less 10-15 times higher than usual). Unfortunately this is not changed by the torchvision downgrade so something else must also be involved. FWIW, with SD 1.5 models result was the issue, not speed – at least not in my case. Edit: of course my issue with SDXL models might be related with my 8GB of ram, but still it didn't happen on macOS 14.3.x. If this is the issue I'll live, it makes sense, so I wonder if anyone with beefier Macs (16GB or more) is experiencing the same. Edit 2: Forget about the SDXL part, I dared to upgrade my main Mac (M2 Pro 16GB) and speed is fine. I guess it's just a matter of memory after all. |
Might be useful to add which sampler/scheduler pairs this "fix" worked for, looking at @cmgaston's post. |
In my case, it works for all the combos I tried |
is there any way to get it? |
I'm using an M1 Ultra 64gb and using dmpp_sde_gpu/normal works fine with SDXL and other models. No change in speed or anything. |
its already giving me dark solid color results, so I think its already affected |
So you just upgraded? No downgrade of torchvision? |
I tried to install |
It is exactly the same problem, just with a slightly different faulty resulting image. Some samplers (mostly ancestral ones) do not work properly on A1111 and Forge on 14.4 and 14.4.1 with torch 2.2.0 or newer. In CPU mode, they give a proper image, but it takes forever. Torch 2.1.2 works without a problem, even on updated macOS. Temporary workaround:
Those do not work on macOS 14.4 or newer:
So, we are currently stuck with Torch 2.1.2 on our Macs. I was on 2.2.1 before the update but had to revert all my installs to 2.1.2. |
Looking at this SO answer, it should be possible to add a Mac-specific line to the requirements.txt file which will temporarily fix this by specifying 2.1.2. Will try this and submit a PR if it works. |
@sagebru5h You need Python 3.11 for torch 2.1.2 |
Thank you! That solved it. |
Looks like the fix got committed today upstream in pytorch (I built pytorch/pytorch@05289a2 from source and comfy works again) but not yet merged to the 2.3 release branch -- nightlies should start working again soon hopefully, and with luck the fix will get into the 2.3 final release which is imminent - since Mac is completely broken without it, I imagine they'll get it in... |
Good news ! |
I believe they will have backports for older versions and the README suggests nightly version of PyTorch for apple silicon anyway. |
Kudos! Fixed my issue |
Patch got merged for the 2.3 release now, so will be in 2.3 |
Ah, ok, great ! |
You can stay on 2.1.2 for now until the release of 2.3.0. Then, you can upgrade to 2.3.0. If you want to use the development version, uninstall the current torch and install nightly bild like this:
|
Hello ! It seems that in my case pip does not want to install torch 2.1.2 !? ERROR: Could not find a version that satisfies the requirement torch==2.1.2 (from versions: 2.2.0, 2.2.1, 2.2.2) ... and I get it even after uninstalling torch and torchvision ! denis
|
You need python3.11 rather than python3.12. |
Thanx a lot for this quick answer !
?? |
Hourra ! |
i'm downgrade python for 3.1.10 and reinstall environment torch==2.1.2 torchvision==0.16.2,fixed some problem but only some k-samples like dpmpp-2m-sde-gpu , others still not work。maybe some add-on's problem? and pic must in 10241024, if 512512 will not work currect |
In my case, it was UPgrading pytorch to 2.3 that solved the problem. |
Try to use the dev version:
No, you are using dev (which is 2.4) 🙃 2.3 is not released yet, but I hope it will be released soon. |
thx very much, it's seems solve the problem. i install the pre version2.4. i will test some samples later |
Hi guys, im very new to all of comfy ui. I installed it on my M1 Mac with Sonoma 14.4.1. Now after a while i got the temporary/half fix done with using torchvision 16.2. But i still have problems when using certain KSampler Settings. Is there still NO official fix for this? Did anyone maybe upgrade his Mac OS to Squoia 15.0.1? Or is there any other fix - i realy would like to use lcm and sgm_uniform but it gives me blurry images... |
Steps to reproduce: Install CUI on MacOS 14.3.x. Update to latest version, 14.4.
Expected behavior: Generation of usable images
Issue: After update, ComfyUI outputs Rothko-esque solid color images (usually cyan or white), unless a ControlNet is used, in which case it outputs a ghostly image of the input on a solid color.
This has been reported to affect both CUI and other SD UI's since the beta version. However, Draw Things appears to function normally.
I have tried updating pytorch to the latest nightly which did not resolve the issue.
Also of note: "generation" time seems much shorter than before the update, tho the output is garbage.
The text was updated successfully, but these errors were encountered: