Audio Crop Batch
Trim by seconds, not by batch index — and reverse it by accident if you're not careful
- audio
- select_audio
- start_audio
- end_audio
- start_batch
- end_batch
Where Audio_Batch_Edit (the pack's other audio node) slices by batch position, Audio Crop Batch slices by actual time - you give it a start and end point in seconds and it trims accordingly, with the same batch-selection controls layered on top for picking which clips in a batch it applies to.
The inputs and outputs that matter
audio is your input, supporting a full batch of clips at once. start_time and end_time are both in seconds, both able to go negative to count backward from the end of the clip instead of the start. There's a specific rule worth knowing: if end_time is 0 and start_time is also 0, nothing gets cropped at all - that's the node's way of saying "no crop requested," not a zero-length output. If end_time ends up earlier than start_time - say your start lands after your end by mistake, or the negative-from-end convention crosses over - the node doesn't error, it outputs the audio in that range reversed. That's a handy trick if you want reversed audio on purpose, and a confusing surprise if you hit it by accident without knowing it's documented behavior.
start_batch and batch_len work the same way as they do on Audio_Batch_Edit: start_batch picks which clip(s) in the input batch this applies to (counting from 0), batch_len sets how many, with negative counting from the end and any excess past the real batch length simply ignored.
Five outputs come back, more than most nodes in this pack, and worth being deliberate about: select_audio is the processed, cropped result within your time range, still batched. start_audio and end_audio are the processed audio before and after the crop window respectively - so cropping out the middle of a clip still gives you clean access to the two pieces you cut away from, not just the piece you kept. start_batch (the output, not to be confused with the input of the same name) gives you back whichever clips in the batch were outside your selected batch range entirely, untouched. end_batch gives you the clips that were inside your selected range and got processed.
Installing it
Same pack, same steps. ComfyUI Manager: search "ComfyUI-WJNodes," install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-WJNodes.git
Find it under WJNode → Audio, next to Audio_Batch_Edit. No models or extra dependencies needed.
Where people get burned
The reversed-audio-on-crossed-times behavior is the one to remember before assuming something's broken - if your output sounds backward, check whether end_time genuinely comes before start_time under the node's negative-from-end math. And the 0/0 no-crop special case is easy to forget if you're driving these values from an upstream calculation that could legitimately land on zero - if you expect a crop but get the full untouched clip back, that's the first thing to check.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| start_time | FLOAT | 0.000-1000000–1000000 | — |
| end_time | FLOAT | 0.000-1000000–1000000 | — |
| start_batch | INT | 0-1000000–1000000 | — |
| batch_len | INT | -1-1000000–1000000 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| select_audio | AUDIO | — |
| start_audio | AUDIO | — |
| end_audio | AUDIO | — |
| start_batch | AUDIO | — |
| end_batch | AUDIO | — |