音频信息
How long is that clip, really? AudioInfo_CutAudio is the stat sheet ComfyUI never shows you
- audio
- 时长(秒)
- 采样率
- 总帧数
The first thing you need before cutting, remixing, or muxing audio is a number: how long is this thing? ComfyUI will happily let a waveform tensor sit on your canvas without ever telling you its duration. AudioInfo_CutAudio is the three-output node that fixes that - it reads an AUDIO wire and hands back the duration in seconds, the sample rate, and how many video frames the audio spans at whatever fps you tell it.
It's part of the small ComfyUI-cut-audio pack (by mailzwj, Apache-2.0), which is one of those packs that shows up as a bundle of four utility nodes under audio/cut-audio in the menu. This is the informational one, and it's the natural first stop in the pack's own suggested workflow: check the clip before you slice it.
How it works
ComfyUI passes audio around as a plain dict: a waveform tensor plus a sample_rate. That's the same shape LTX-Video's audio nodes and ComfyUI's native audio handling use, so anything that produces an AUDIO output plugs straight in. The node does the obvious math - duration is number of samples ÷ sample_rate, frame count is duration × fps, rounded - and hands you three numbers.
Nothing fancy, and that's the point. There's no model, no download, no heavy dependency. The whole pack depends on nothing but torch, which you already have.
The inputs and outputs that matter
Just two inputs, and you'll touch one of them:
audio(AUDIO) - any audio wire: from a load node, from a TTS node, fromAudioSplitBySilence_CutAudio's batched output.fps(FLOAT, default 24.0) - only used to compute the frame count. Set it to your actual project's fps (24, 25, or 30) or the number is garbage.
Outputs, all three at once:
时长(秒)(FLOAT) - total duration in seconds.采样率(INT) - sample rate in Hz. This is the one that catches people: a 44.1 kHz clip and a 48 kHz clip will both sound fine until you re-encode and your video drifts out of sync. Check it before muxing.总帧数(INT) - duration × fps, rounded.
Wire the INT/FLOAT outputs into a display node, or convert them to widgets and use them to drive an AudioManualCut_CutAudio later in the graph. The frame count is handy for the classic job this whole pack exists for: making sure a piece of audio is exactly as long as the video it's being attached to.
Installing it
The usual two ways. In ComfyUI Manager, search for ComfyUI-cut-audio and hit install. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/mailzwj/ComfyUI-cut-audio.git
Then restart ComfyUI. One catch worth knowing up front: this pack is written against ComfyUI's newer backend node API (comfy_api.latest), so it wants a reasonably current ComfyUI install. The README notes comfy_api is normally built in - if you're on an old install and the nodes don't appear, update ComfyUI rather than hunting for a pip package. No model files to download, nothing else to install.
Where it bites
Two small traps, both real.
First, the node measures waveform.shape[-1] directly. If you feed it the padded batch that AudioSplitBySilence_CutAudio outputs - where every segment is right-padded with zeros up to the longest one - the duration you get includes that padding. Feed it a single clip, not a padded batch, or read the splitter's alignment output instead.
Second, the frame count is rounded, so it's planning-grade, not frame-exact. If you need a cut to land on an exact video frame, do the arithmetic yourself or check the sample rate and do it from samples. For "is this 12 seconds or 20" - which is what you actually need before you start cutting - it's perfect.
It's a quiet little node, but it's the kind of thing that saves you from discovering a 10-minute narration clip at the wrong sample rate halfway through an export. Check first, cut second.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| fps | FLOAT | 24.001–120 | 视频帧率,用于计算音频对应的视频总帧数。 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 时长(秒) | FLOAT | — |
| 采样率 | INT | — |
| 总帧数 | INT | — |