Nodes/PromptMasterLD/⏱ Audio Duration - LD
ComfyUI Node

⏱ Audio Duration - LD

How Long Is That Track, Really? Measure It Instead of Typing a Number

By Lora-Daddy·Created 6 days ago·Updated 2 days ago· 5
⏱ Audio Duration - LD
  • audio
  • seconds
  • frames
  • segments
  • report
fps24
segment_seconds10.0

The number you're typing is a lie, and this node exists to fix it

Every H3 workflow asks for a duration somewhere: H3 Studio's seconds dial, the Music Video node's per-segment length. And until this node existed, that number came from a Primitive node where someone had typed "120.00" and hoped it matched the actual song. The pack's own notes are blunt about what happened: set the target to 120 and the Music 3 sampler's max_duration to 60 and you silently get a 60-second track. Two numbers, never reconciled, and the mismatch only shows up in the render.

AudioDurationLD is the "measure instead of trust" fix. You feed it an AUDIO, it tells you how long that audio actually is - in seconds, in frames at whatever fps you pick, and in how many fixed-length segments it cuts into. No sample-rate guessing, no reading the MP3 header and hoping it matches the decoded file.

How it works

An AUDIO object in ComfyUI carries its own waveform and sample rate. Length is arithmetic: samples divided by rate. So there's nothing clever happening - the node reads waveform.shape[-1] / sample_rate and hands you the number. That's exactly why it's worth wiring in: it measures the decoded audio, which is the same thing the sampler downstream will actually hear, not the file's metadata claim.

AudioDurationLD lives in the PromptMasterLD pack (Lora-Daddy's MiniMax H3 pipeline, from the same author as the LTX-2 "Easy Prompt" nodes). It shows up as ⏱ Audio Duration - LD under LD / PromptMaster.

The inputs and outputs that matter

Three inputs, all simple:

  • audio - the AUDIO you want measured.
  • fps (default 24) - used for the frames output only.
  • segment_seconds (default 10) - how long each segment should be, for the segments output only. Keep it under 15: H3 caps an audio reference at 15 seconds, so that's the practical ceiling for anything you're feeding a shot.

Four outputs, and the two you'll actually wire:

  • seconds - a FLOAT you can run straight into H3 Studio's seconds_in override or the Music Video node's seconds.
  • frames - the same length as frame count at your fps. Handy when something downstream wants a whole number.
  • segments - how many segment_seconds clips the track splits into.
  • report - a STRING summary, useful for logging or a debug text node.

How to install

It ships inside PromptMasterLD, so you install the whole pack once:

cd ComfyUI/custom_nodes
git clone https://github.com/Lora-Daddy/PromptMasterLD
cd PromptMasterLD
pip install -r requirements.txt

Then restart ComfyUI. In ComfyUI Manager, search for "PromptMasterLD" and install the same way. The only hard dependency the pack adds beyond what ComfyUI already ships is opencv-python - if you're just using this measurement node you won't touch the LM Studio backend at all, but it comes along for the ride.

Where people get burned

The 15-second cap is the one that bites. segment_seconds defaults to 10, and if you bump it to 20 the node will happily tell you a 40-second track needs two segments - but feed a 20-second audio reference to an H3 sampler and MiniMax caps it anyway. Measure, then keep segment lengths at or under the 15s reference limit. And remember the node measures whatever AUDIO you hand it: if you bypass a rail and the audio slot goes empty, the output is silence-length, which is a different kind of surprise than a wrong number.

CategoryLD/PromptMaster

Inputs (3)

NameTypeDefaultDescription
audioAUDIO
fpsINT241–240For the `frames` output only.
segment_secondsFLOAT10.00.5–60For the `segments` output only — how many clips of this length the track needs. H3 caps an audio reference at 15s.

Outputs (4)

NameTypeDescription
secondsFLOAT
framesINT
segmentsINT
reportSTRING