Comfy-Org/ComfyUI · error · ValueError

SaveAudio: input audio is None (source video may have no aud

Error message

SaveAudio: input audio is None (source video may have no audio track).

What it means

SaveAudio.execute raises when its audio argument is None, mirroring the same pattern as VAEEncodeAudio: a video source without an audio track propagated a None into a node that must write audio. It fails fast rather than writing an empty file.

Source

Thrown at comfy_extras/nodes_audio.py:181

            node_id="SaveAudio",
            search_aliases=["export flac"],
            display_name="Save Audio (FLAC) (DEPRECATED)",
            category="audio",
            essentials_category="Audio",
            inputs=[
                IO.Audio.Input("audio"),
                IO.String.Input("filename_prefix", default="audio/ComfyUI"),
            ],
            hidden=[IO.Hidden.prompt, IO.Hidden.extra_pnginfo],
            is_deprecated=True,
            is_output_node=True,
            outputs=[IO.Audio.Output("audio")]
        )

    @classmethod
    def execute(cls, audio, filename_prefix="ComfyUI", format="flac") -> IO.NodeOutput:
        if audio is None:
            raise ValueError("SaveAudio: input audio is None (source video may have no audio track).")
        return IO.NodeOutput(
            audio,
            ui=UI.AudioSaveHelper.get_save_audio_ui(audio, filename_prefix=filename_prefix, cls=cls, format=format)
        )


class SaveAudioMP3(IO.ComfyNode):
    @classmethod
    def define_schema(cls):
        return IO.Schema(
            node_id="SaveAudioMP3",
            search_aliases=["export mp3"],
            display_name="Save Audio (MP3) (DEPRECATED)",
            category="audio",
            essentials_category="Audio",
            inputs=[
                IO.Audio.Input("audio"),
                IO.String.Input("filename_prefix", default="audio/ComfyUI"),

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Verify the source video has an audio stream (ffprobe) or replace it with one that does
  2. Route a real LoadAudio/LoadVideo(with audio) node into the save node
  3. Branch around the save node when audio is None using a switch/gate node
Defensive patterns

Strategy: type-guard

Validate before calling

if audio is None:
    skip_save = True  # do not execute SaveAudio

Type guard

def is_audio(v) -> bool:
    return isinstance(v, dict) and 'waveform' in v and 'sample_rate' in v

Prevention

When it happens

Trigger: Connecting a LoadVideo-based audio output that is None (video has no audio stream) into SaveAudio. Passing None from any optional audio socket that was left unconnected or upstream-skipped.

Common situations: Automated batch jobs over mixed video collections where some inputs are silent; deprecated-node workflows still using SaveAudio instead of the newer save path.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/aa81ad407971eca4. Report an issue: GitHub.