Nodes/ComfyUI-LoadAudioandSplit/Load Audio and Split
ComfyUI Node

Load Audio and Split

Splitting audio to match scene lengths

By ckinpdx·Created 9 months ago·Updated 9 months ago· 1
Load Audio and Split
  • audio
  • scene_count
  • final_timestamp
  • audio_1
  • audio_2
  • audio_3
  • audio_4
  • audio_5
  • audio_6
  • audio_7
  • audio_8
fps25.00
overlap_frames0
frames_1
frames_2
frames_3
frames_4
frames_5
frames_6
frames_7
frames_8

The problem this node solves is real even if you've never heard of it: you've got a Wan keyframe workflow where each scene is defined by a frame count, and you want the audio to line up scene-for-scene. ComfyUI has no idea how to do that by itself. LoadAudioandSplit takes an already-loaded audio clip and slices it into up to eight chunks whose durations are computed straight from your frame counts at whatever FPS you're rendering at. Scene 1 is 97 frames at 25fps, so you get 3.88 seconds of audio; scene 2 starts where scene 1 ends (minus any overlap), and so on. It's a tiny node that does one thing, but it's the difference between manually scrubbing timestamps and just wiring it up.

First, the name is half a lie. It says "Load" but it doesn't load anything - its audio input takes the standard ComfyUI AUDIO type, which you'll get from VideoHelperSuite's Load Audio node. Core ComfyUI doesn't ship an audio loader, so if you're missing that, that's why. What this node actually does is split.

How it works

The math is about as simple as it gets: duration = frames / fps. Each frames_N input is a scene length in frames, and the node walks through them building start times, so chunk i+1 begins at start_i + duration_i − overlap. That overlap is the key to its other trick: overlapping chunks for seamless transitions, the kind of thing you'd crossfade in post or feed to a longer-generation pipeline that wants continuity between segments.

It auto-detects how many scenes you have by scanning frames_1 through frames_8 and stopping at the first unconnected one. That's the gotcha to remember: connections have to be contiguous from frames_1. Wire up frames_1 and frames_3 but leave frames_2 dangling, and you get one scene, not three. Leave everything unconnected and it falls back to a single 97-frame scene, which is a reasonable default but probably not what you meant.

Inputs that matter

  • audio (AUDIO) - your source clip, typically from VHS Load Audio.
  • fps (FLOAT, default 25) - must match the frame rate you're generating video at, or every chunk drifts.
  • overlap_frames (INT, default 0) - frames of overlap between chunks; set it to match the overlap your keyframe builder uses.
  • frames_1 … frames_8 (INT) - scene durations in frames. These are forceInput, so you'll wire a number into each rather than typing it, and you only connect the ones you need.

What comes out

scene_count (INT) tells you how many segments it actually made; final_timestamp (FLOAT) gives the end time of the last chunk in seconds, handy for keeping downstream video the same length. Then audio_1 through audio_8 are the slices, with unused outputs returning None so you can ignore them.

Two behaviors to know before they bite. A chunk that runs past the end of your track comes back as silence, not a short clip - so if your scenes add up to more than the audio, you get dead air and no error to tell you. And mono gets upconverted to stereo, while sample rate passes through untouched; if your audio-to-video stage wants a specific rate, resample upstream.

Install and troubleshooting

Via ComfyUI Manager (search "ComfyUI-LoadAudioandSplit"), or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/ckinpdx/ComfyUI-LoadAudioandSplit

Restart ComfyUI. That's it - no requirements.txt, no model downloads, no API key. One node, one file, dependencies are just the torch ComfyUI already has. If your outputs are missing, the usual culprit is not having an AUDIO source (install VideoHelperSuite); if chunks come out short and silent, your track is shorter than your scene sum; if the scene count looks wrong, check that your frames_N connections are contiguous.

It's a narrow tool from ckinpdx, a regular on r/comfyui who shares Wan/LTX keyframe workflows - the wankeyframebuilder category is the giveaway that this is a companion piece to his own workflow style rather than a general utility. But if you're building music-video-style keyframed scenes, it's the one that keeps audio and video honest with each other.

Categorywankeyframebuilder

Inputs (11)

NameTypeDefaultDescription
audioAUDIO
fpsFLOAT25.000.001–120
overlap_framesINT00–500
frames_1optINT
frames_2optINT
frames_3optINT
frames_4optINT
frames_5optINT
frames_6optINT
frames_7optINT
frames_8optINT

Outputs (10)

NameTypeDescription
scene_countINT
final_timestampFLOAT
audio_1AUDIO
audio_2AUDIO
audio_3AUDIO
audio_4AUDIO
audio_5AUDIO
audio_6AUDIO
audio_7AUDIO
audio_8AUDIO