Nodes/ComfyUI-JakeUpgrade/Cut Audio Loop JK๐Ÿ‰
ComfyUI Node

Cut Audio Loop JK๐Ÿ‰

Cut Audio Loop JK for long-video generation

By jakechaiยทCreated 2 years agoยทUpdated 3 months agoยท 147
Cut Audio Loop JK๐Ÿ‰
  • audio
  • audio
  • duration
  • start
  • end
โ—„fps16โ–บ
โ—„segment_frame_count81โ–บ
โ—„overlap_frame_count10โ–บ
โ—„index0โ–บ

Long-video generation in Wan doesn't render forever in one shot - you loop over segments, each one seeded by the tail of the last. If your video is being driven by audio, each loop iteration needs the matching slice of that audio. Cut Audio Loop JK is the node that computes that slice from the same frame math your loop is already using: fps, segment_frame_count, overlap_frame_count, and an index.

Where the other JK audio cutters take seconds or scene metadata, this one speaks frames, which is exactly right for loop-based generation. The math it does:

  • loop_duration = segment_frame_count / fps - how long one video segment is.
  • overlap_duration = overlap_frame_count / fps - the overlap you configured for Context Window or for-loop long-vid generation.
  • For index > 0, start_time = (loop_duration - overlap_duration) * index. The first segment starts at 0; every later one backs up by the overlap so the audio, like the video, stitches seamlessly.

Outputs are the useful quartet: the cut audio, the actual duration, plus start and end as floats. Those last two are the ones that make this node valuable beyond the audio itself - you can feed start/end straight into your video sampler logic so the visual segment is cut to exactly the same window, keeping sync guaranteed rather than approximate.

Defaults are Wan-shaped: fps = 16, segment_frame_count = 81 (Wan's frame-count compatibility pattern), overlap_frame_count = 10. Change them to match whatever your video wrapper expects.

Install. It's in ComfyUI-JakeUpgrade:

cd ComfyUI/custom_nodes
git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
cd ComfyUI-JakeUpgrade
pip install -r requirements.txt

Or ComfyUI Manager โ†’ "JakeUpgrade". Windows portable: install.bat or ../../../python_embeded/python.exe -s -m pip install -r requirements.txt. Restart. No model downloads.

Gotchas: index is validated against the audio's total duration, so asking for a segment that starts past the end raises a clear error - guard your loop's upper bound. If end_time runs past the audio, the node pads with silence (not a clamp), so your last segment keeps full length; that's usually what you want for a loop. And the family rules: keep the pack's audio module enabled in config.ini (and video, if you're pairing this with Scene Cuts), set LOAD_DEPRECATED_NODES = True if JK nodes show up missing, and disable ComfyUI MultiGPU per the README to dodge CUDA errors.

Category๐Ÿ‰ JK/๐ŸŽป Audio

Inputs (5)

NameTypeDefaultDescription
audioAUDIOโ€”
fpsINT161โ€“120โ€”
segment_frame_countINT811โ€“1000โ€”
overlap_frame_countINT104โ€“100Overlap frames for Context Window or for-loop long-vid generation.
indexINT00โ€“100โ€”

Outputs (4)

NameTypeDescription
audioAUDIOโ€”
durationFLOATโ€”
startFLOATโ€”
endFLOATโ€”