問題1: AssertionError: Torch not compiled with CUDA enabled?
解決辦法:修改代碼以 CPU 運行
第一步:找到 /ComfyUI/custom_nodes/ComfyUI-MMAudio/mmaudio/ext/autoencoder/vae.py文件中的下面這兩行代碼
self.data_mean = nn.Buffer(torch.tensor(DATA_MEAN_128D, dtype=torch.float32).cuda())
self.data_std = nn.Buffer(torch.tensor(DATA_STD_128D, dtype=torch.float32).cuda())
第二步:將其修改為:
self.data_mean = nn.Buffer(torch.tensor(DATA_MEAN_128D, dtype=torch.float32).cpu())
self.data_std = nn.Buffer(torch.tensor(DATA_STD_128D, dtype=torch.float32).cpu())
問題2: NotImplementedError: The operator ‘aten::_upsample_bicubic2d_aa.out’ is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment variable PYTORCH_ENABLE_MPS_FALLBACK=1
to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS?
解決辦法:臨時解決辦法:啟用 MPS 回退機制
在main.py中 import os 后面添加如下代碼:
import os
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
問題3: ComfyUI/custom_nodes/ComfyUI-MMAudio/mmaudio/model/utils/features_utils.py", line 112, in encode_video_with_sync x = torch.stack(segments, dim=1) # (B, S, T, C, H, W) RuntimeError: stack expects a non-empty TensorList?
解決辦法:上傳的視頻時長太短,重新選擇時長稍微長些的視頻。
問題4: NotImplementedError: Output channels > 65536 not supported at the MPS device?
解決辦法:更新 PyTorch 版本
pip install --upgrade torch torchvision torchaudio