Comfy-Org / Comfy-Org/ComfyUI

Apple Silicon Compatibility with torch > 2.4.1

Open
#9,256 1 comment 0 reactions 0 assignees View on GitHub
bug-cop:taking-a-look Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

Generate image larger than 2048x2048 on Apple Silicon macOS with latest requirements.txt

### Actual Behavior

ComfyUI crashes with error:
```
/AppleInternal/Library/BuildRoots/.../MPSNDArray.mm:829: failed assertion ... Error: NDArray dimension length > INT_MAX'
```

### Steps to Reproduce

1. Install latest version of ComfyUI with torch > 2.4.1 on Apple Silicon macOS
2. Generate an image with dimensions larger than 2048 x 2048

### Debug Logs

```powershell
/AppleInternal/Library/BuildRoots/.../MPSNDArray.mm:829: failed assertion ... Error: NDArray dimension length > INT_MAX'
```

### Other

I have tried to downgrade Torch to 2.4.1, which fixed the issue temporarily.

```bash
pip install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1
```

However, the issue remains with any later version of torch.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.