Skip to content

Commit fd08e39

Browse files
Make torchaudio not a hard requirement. (#7987)
Some platforms can't install it apparently so if it's not there it should only break models that actually use it.
1 parent 56b6ee6 commit fd08e39

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

comfy/ldm/ace/vae/music_dcae_pipeline.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# Original from: https://github.com/ace-step/ACE-Step/blob/main/music_dcae/music_dcae_pipeline.py
22
import torch
33
from .autoencoder_dc import AutoencoderDC
4-
import torchaudio
4+
import logging
5+
try:
6+
import torchaudio
7+
except:
8+
logging.warning("torchaudio missing, ACE model will be broken")
9+
510
import torchvision.transforms as transforms
611
from .music_vocoder import ADaMoSHiFiGANV1
712

comfy/ldm/ace/vae/music_log_mel.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
import torch
33
import torch.nn as nn
44
from torch import Tensor
5-
from torchaudio.transforms import MelScale
5+
import logging
6+
try:
7+
from torchaudio.transforms import MelScale
8+
except:
9+
logging.warning("torchaudio missing, ACE model will be broken")
10+
611
import comfy.model_management
712

813
class LinearSpectrogram(nn.Module):

0 commit comments

Comments
 (0)