Comfy-Org/ComfyUI · error · ValueError
AudioSplit: Input audio must be stereo (2 channels), got {wa
Error message
AudioSplit: Input audio must be stereo (2 channels), got {waveform.shape[1]} channel(s). What it means
The stereo splitter indexes waveform[..., 0:1, :] and [..., 1:2, :], so it requires exactly 2 channels in dim 1. Mono (1), 5.1 (6), or any other channel count raises immediately with the offending count.
Source
Thrown at comfy_extras/nodes_audio.py:510
category="audio",
inputs=[
IO.Audio.Input("audio"),
],
outputs=[
IO.Audio.Output(display_name="left"),
IO.Audio.Output(display_name="right"),
],
)
@classmethod
def execute(cls, audio) -> IO.NodeOutput:
if audio is None:
return IO.NodeOutput(None, None)
waveform = audio["waveform"]
sample_rate = audio["sample_rate"]
if waveform.shape[1] != 2:
raise ValueError(f"AudioSplit: Input audio must be stereo (2 channels), got {waveform.shape[1]} channel(s).")
left_channel = waveform[..., 0:1, :]
right_channel = waveform[..., 1:2, :]
return IO.NodeOutput({"waveform": left_channel, "sample_rate": sample_rate}, {"waveform": right_channel, "sample_rate": sample_rate})
separate = execute # TODO: remove
class JoinAudioChannels(IO.ComfyNode):
@classmethod
def define_schema(cls):
return IO.Schema(
node_id="JoinAudioChannels",
display_name="Join Audio Channels",
description="Joins left and right mono audio channels into a stereo audio.",
category="audio",
inputs=[
IO.Audio.Input("audio_left"),View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Check waveform.shape[1] before splitting and adapt (mono needs no split)
- Convert to stereo first (torch.cat([wav, wav], dim=1)) if duplication is acceptable
- Use SplitAudioChannels for arbitrary channel counts instead of the stereo-only AudioSplit
- Fix the source/export to stereo if stereo is genuinely required
Example fix
// before
left, right = AudioSplit(audio) # mono input -> raises
// after
if audio['waveform'].shape[1] == 1:
audio = {'waveform': audio['waveform'].repeat(1, 2, 1), 'sample_rate': audio['sample_rate']}
left, right = AudioSplit(audio) Defensive patterns
Strategy: type-guard
Validate before calling
if waveform.shape[1] != 2:
if waveform.shape[1] == 1:
waveform = waveform.repeat(1, 2, 1) # mono -> stereo
else:
waveform = waveform[:, :2, :] # take first two channels Type guard
def is_stereo(audio) -> bool:
return audio is not None and audio['waveform'].shape[1] == 2 Prevention
- Check the channel dim before stereo-only ops
- Use SplitAudioChannels for arbitrary channel counts
- Fix mono sources at export time when stereo is required
When it happens
Trigger: Feeding mono audio (e.g. from JoinAudioChannel of a single channel, a mono TTS output, or a mono WAV via LoadAudio) into the split node; feeding multichannel surround audio.
Common situations: Workflows that assume line/video audio is stereo but receive mono narration; chains where an upstream channel op already collapsed to mono; device-specific mono capture.
Related errors
- AudioJoin: Both input audios must be mono.
- ERROR: audio encoder file is invalid or unsupported embed_di
- ERROR: audio encoder not supported.
- Image-token count {image_idx.shape[0]} != ViT output count {
- attention_mask must be {expected}, got {tuple(attention_mask
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/e09ff8a2b9335c19.
Report an issue: GitHub.