Nodes/SongBloom_ComfyUI/SongBloom Audio Cropper
ComfyUI Node

SongBloom Audio Cropper

Cut a reference clip down to size before SongBloom uses it

By xuchenxu168·Created 11 months ago·Updated 10 months ago· 15
SongBloom Audio Cropper
  • audio
  • cropped_audio
  • info
start_sec0.00
end_sec10.00
pad_to_endfalse

SongBloom's whole trick is that it takes a short audio reference - a few seconds of melody - and sings your lyrics over something close to it. That reference wants to be roughly 5–15 seconds, and it wants to be the right 5–15 seconds. This node is how you get there: it slices any AUDIO tensor between a start_sec and end_sec and hands you a cropped segment, ready to feed into SongBloomAudioPrompt and then the generator.

The practical use is the one the community lands on again and again: don't feed SongBloom the intro of a track and hope for the best - crop a verse or a chorus and use that as your style reference. The model latches onto melody and rhythm much harder when the segment is representative of the music you actually want back. This node turns "whole song" into "the good bit."

Inputs

  • audio (required) - any AUDIO: a file loaded elsewhere, output from another node, or a generated song you want to reuse as a reference for the next one.
  • start_sec (required) - where the cut begins, default 0.
  • end_sec (required) - where it ends, default 10. Must be greater than start_sec.

The one optional input:

  • pad_to_end - default off. Turn it on and the crop runs to the actual end of the file even if it's shorter than your end_sec, instead of erroring out.

Outputs

  • cropped_audio (AUDIO) - the segment, in standard {waveform, sample_rate} form. Wire it into SongBloomAudioPrompt's audio input (path-free reference) or straight to the generator.
  • info (STRING) - what the crop did, including the resulting duration.

Under the hood it's careful about shapes: it normalizes whatever waveform it receives to (channels, samples) - squeezing a batch dimension, adding a channel dimension if it got a flat 1D tensor - so the output plays nice with everything downstream. If a crop would come up empty, it falls back to a tiny pad of silence rather than crashing the graph, which is the kind of defensive coding that saves you a session of head-scratching.

Install & the one trap

Standard pack install:

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

ComfyUI Manager: search "SongBloom_ComfyUI". Restart and it's under SongBloom/Audio.

The trap is timing yourself wrong. end_sec and start_sec are in seconds of the source clip, so if your reference is a 3-minute track and you want the chorus at 1:10, you're setting start_sec: 70, end_sec: 80 - not minutes. The other thing to remember is this node doesn't resample or convert to mono; that normalization happens later in SongBloomAudioPrompt. Crop first, then prompt, then generate - that chain is the intended design.

CategorySongBloom/Audio

Inputs (4)

NameTypeDefaultDescription
audioAUDIO
start_secFLOAT0.000–1000000
end_secFLOAT10.000–1000000
pad_to_endoptBOOLEANfalse

Outputs (2)

NameTypeDescription
cropped_audioAUDIO
infoSTRING