Nodes/Story JSON Nodes/Save Audio Passthrough
ComfyUI Node

Save Audio Passthrough

Save voiceovers as WAV and pass the audio along

By stepan-bogatorjov·Created 5 months ago·Updated about a month ago· 0
Save Audio Passthrough
  • audio
  • audio
filename_prefixscene
output_folder
add_countertrue

SaveAudioPassthrough is how per-scene narration gets out of the graph and onto disk in the Story JSON Nodes pack (stepan-bogatorjov/comfy_scenes_json_node). It takes an AUDIO object, writes it as a 16-bit PCM WAV into ComfyUI's output folder, and returns the same AUDIO out the other socket so the wire continues.

The naming is the whole game. Default prefix scene with the counter on produces scene_00001.wav, scene_00002.wav and so on - and that's the exact <scene>_<counter>.<ext> scheme StoryFinalCompile greps for when it matches each scene's voiceover to its video. Wire KokoroSceneAudio (or MockSceneAudio) into it per scene, and when the compiler runs it finds one voiceover per scene number automatically, delays each to its scene's start on the timeline, and lays it over the video. Get the prefix wrong and the compiler just sees no voiceovers and your final cut is silent narration-wise.

How it works

The node unwraps the AUDIO dict (waveform + sample_rate), handles mono, stereo and multi-clip batches, clamps to ±1, converts to int16, and writes a standard WAV (PCM 16-bit) with Python's wave module. The counter bumps until it finds a free filename, so it never overwrites previous runs. The output is the input, untouched - that's the passthrough part.

The inputs that matter

  • audio - the AUDIO in; from KokoroSceneAudio, MusicGenAudio, MockSceneAudio, or anywhere else that emits the standard AUDIO type.
  • filename_prefix - default scene. Keep it if these files are scene voiceovers.
  • output_folder - optional subfolder under output/. The compiler's voiceover lookup is a separate folder field, so this is how you keep audio tidy.
  • add_counter - on by default. Off writes scene.wav and overwrites on every run.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/stepan-bogatorjov/comfy_scenes_json_node

Restart ComfyUI (or install via Manager under "Story JSON Nodes"). The node itself needs nothing beyond ComfyUI's bundled audio handling.

Troubleshooting

The WAV files go to ComfyUI/output/ unless you set output_folder - and if you do, make sure StoryFinalCompile's voiceover_folder points at the same place, otherwise the compiler finds nothing. Files are named after the prefix, not the scene text, so a single long run produces a clean scene_00001.wav per scene regardless of what each says. And if you're feeding multi-clip audio in one go, it writes each clip as its own numbered file rather than one big file.

Categoryaudio

Inputs (4)

NameTypeDefaultDescription
audioAUDIO
filename_prefixSTRINGscene
output_folderSTRING
add_counterBOOLEANtrue

Outputs (1)

NameTypeDescription
audioAUDIO