{"record":{"id":"aef2074715a4fb8b","repo":"Comfy-Org/ComfyUI","slug":"unsupported-audio-channels-audio-channels","errorCode":null,"errorMessage":"Unsupported audio_channels: {audio_channels}","messagePattern":"Unsupported audio_channels: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/lightricks/vae/audio_vae.py","lineNumber":197,"sourceCode":"            target_length -= LATENT_DOWNSAMPLE_FACTOR - 1\n        return (\n            batch,\n            self.autoencoder.decoder.out_ch,\n            target_length,\n            self.autoencoder.mel_bins,\n        )\n\n    def num_of_latents_from_frames(self, frames_number: int, frame_rate: float) -> int:\n        return round((float(frames_number) / frame_rate) * self.latents_per_second)\n\n    def run_vocoder(self, mel_spec: torch.Tensor) -> torch.Tensor:\n        audio_channels = self.autoencoder.decoder.out_ch\n        vocoder_input = mel_spec.transpose(2, 3)\n\n        if audio_channels == 1:\n            vocoder_input = vocoder_input.squeeze(1)\n        elif audio_channels != 2:\n            raise ValueError(f\"Unsupported audio_channels: {audio_channels}\")\n\n        return self.vocoder(vocoder_input)\n\n    @property\n    def sample_rate(self) -> int:\n        return int(self.autoencoder.sampling_rate)\n\n    @property\n    def mel_hop_length(self) -> int:\n        return int(self.autoencoder.mel_hop_length)\n\n    @property\n    def mel_bins(self) -> int:\n        return int(self.autoencoder.mel_bins)\n\n    @property\n    def latent_channels(self) -> int:\n        return int(self.autoencoder.decoder.z_channels)","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/lightricks/vae/audio_vae.py#L179-L215","documentation":"The vocoder wrapper handles decoder output of 1 channel (squeeze to mono vocoder input) or 2 channels (stereo); decoder.out_ch anything else (e.g. 4 or 6 from an unsupported checkpoint) has no defined vocoder path and run_vocoder refuses it.","triggerScenarios":"Loading an audio VAE checkpoint whose decoder out_ch is neither 1 nor 2 and then decoding latents through run_vocoder.","commonSituations":"Experimental or mis-converted audio checkpoints, or mixing a decoder with a vocoder built for a different channel layout.","solutions":["Use a checkpoint whose audio decoder outputs 1 or 2 channels","Re-convert/verify the checkpoint's decoder out_ch matches the vocoder's expected layout","If out_ch is wrong from conversion, fix the conversion script rather than bypassing the check"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"ch = audio_vae.autoencoder.decoder.out_ch\nassert ch in (1, 2), f\"unsupported decoder out_ch {ch}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify decoder.out_ch immediately after checkpoint load","Only pair decoders with vocoders of matching channel layout"],"tags":["ltx","audio-vae","vocoder","unsupported-checkpoint"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}