Spectrogram Custom Node for ComfyUI
Perfil del paquete
Léeme
A ComfyUI custom node that converts an audio input into a spectrogram image.
이미지 스펙트럼 예시
Fuentes
3 fuentesExtractos de fuentes
1 extractoSource context: Repo bemoregt/ComfyUI_Spectrogram
inferno, magma, viridis, plasma, hot, cool, graytorchaudio when available; falls back to NumPy STFT automaticallyCopy this directory into ComfyUI's custom_nodes folder:
ComfyUI/
└── custom_nodes/
└── CustomNode_Bispectrum/
├── __init__.py
├── nodes.py
└── pyproject.toml
Then restart ComfyUI. The node will appear under the audio category.
| Package | Required | Notes |
|---|---|---|
torch | Yes | Comes with ComfyUI |
matplotlib | Yes | Used for rendering |
Pillow | Yes | Image conversion |
numpy | Yes | Array operations |
torchaudio | Recommended | Faster STFT / Mel transforms |
Install recommended dependencies:
pip install torchaudio matplotlib Pillow
Category: audio
| Parameter | Type | Default | Description |
|---|---|---|---|
audio | AUDIO | — | ComfyUI audio input |
use_mel | BOOLEAN | True | True = Mel spectrogram, False = Linear spectrogram |
n_fft | INT | 2048 | FFT window size (256–8192) |
hop_length | INT | 512 | Frame hop size in samples (64–2048) |
win_length | INT | 2048 | Analysis window length (256–8192) |
| Name | Type | Shape | Description |
|---|---|---|---|
spectrogram | IMAGE | [1, H, W, 3] | Float32 RGB image, values in [0, 1] |
audio input of Audio to Spectrogram.spectrogram to a Preview Image or Save Image node.use_mel, fmax, and colormap to taste.MIT
Nodos de este paquete
1 nodoVerificado 13 sept
Verificado 13 sept
n_mels| INT |
128 |
| Number of Mel filter banks (Mel mode only) |
fmin | FLOAT | 0.0 | Minimum frequency in Hz |
fmax | FLOAT | 8000.0 | Maximum frequency in Hz (set to 0 for Nyquist) |
colormap | COMBO | inferno | Matplotlib colormap |
width | INT | 1024 | Output image width in pixels |
height | INT | 512 | Output image height in pixels |
show_axes | BOOLEAN | True | Show time/frequency axes, colorbar, and title |