Nodes/KIE.ai Nodes Next/KIE • Assemble Video + Music
ComfyUI Node

KIE • Assemble Video + Music

The last node before your export

By felipederosilva·Created 2 months ago·Updated 3 days ago· 3
KIE • Assemble Video + Music
  • video_1
  • music
  • video_2
  • video_3
  • video_4
  • dialogue_audio
  • sfx_1
  • sfx_2
  • video
  • assembly_report_json
◄music_gain_db-6.0►
◄short_musicpad silence►
◄fade_seconds1.0►
◄dialogue_duck_db12.0►
◄sfx_1_time_seconds0.0►
◄sfx_2_time_seconds0.0►

What this node is for

You've got your paid KIE takes back - two, three, four clips from Seedance or Kling or whatever you're renting this week - plus a music track, and you need one finished file. KIE • Assemble Video + Music is that step. It stitches up to four videos with hard cuts, fits one music track to the total runtime, optionally ducks the music under dialogue, drops in two timed sound effects, and hands you a single VIDEO you send to KIE • Save Video.

It does the boring part in the graph instead of in an editor: no round trip to Resolve just to butt-join four clips and lay a bed under them.

What it actually does

Concatenation is hard cuts, in the order video_1 → video_4. Before anything else it checks that all takes share dimensions and frame rate and throws a plain error if they don't - resize and re-encode upstream rather than hoping.

The audio side is where the work is. It sums the take durations, then fits your music to that length. If the track is longer it's trimmed. If it's shorter, short_music decides: pad silence appends silence, or loop with crossfade rebuilds the track with a short equal-power overlap join so you don't hear the seam. There's a guard: if the loop needs more than 64 repeats, or the source is too short to crossfade, it tells you to use padding instead.

fade_seconds fades the music in at the top and out at the end. music_gain_db defaults to −6, which is a sane starting bed level.

Then, if you connect dialogue_audio, the music gets ducked under it. Read the README's own caveat and the source together, because it's the thing people misread: this is audio-level ducking, not speech recognition. The code takes RMS in 20 ms blocks, holds and smooths the envelope so it doesn't pump between syllables, and pulls the music down by dialogue_duck_db (12 dB default) while it's loud. It never touches the dialogue gain and never guesses words. sfx_1 and sfx_2 are mixed in at sfx_1_time_seconds and sfx_2_time_seconds. The final mix is peak-protected at just under full scale.

The gotcha worth internalising: source video audio is replaced. Your takes' own soundtrack is gone. If the dialogue matters, pull it out separately - ComfyUI's Get Video Components - and wire it into dialogue_audio.

Two outputs: video, and assembly_report_json with take durations, take count, "transition": "hard cut", which effects landed where, and whether any peak safety reduction was applied. That report is your QA log; it's also JSON you can hand to KIE • Save Generation Recipe.

The inputs a beginner actually touches

  • video_1 and music are required; everything else is optional. One take and one track is a valid graph.
  • short_music - pick loop with crossfade for a track with a beat, pad silence for ambient.
  • dialogue_duck_db - 12 dB is polite, 0 disables ducking entirely.

Install

The pack ships as one repo. No one-click installer exists for this release, so use the ZIP or ComfyUI Manager if the Registry listing is approved.

cd ComfyUI/custom_nodes
git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
python -m pip install -r ComfyUI-KIE-Nodes-Next/requirements.txt

Dependencies are light - requests, Pillow, numpy, PyYAML. Nothing here wants GPU. Then put your key in Settings → KIE.ai Nodes Next → Connection. This node itself makes no API calls and spends nothing; it's local ffmpeg-free torch arithmetic.

Where people get burned

  • Mismatched takes. Different resolution or fps across clips is refused outright. That's a feature - a silently letterboxed join is worse.
  • Dialogue without torchaudio. If your dialogue or SFX has a different sample rate from the music, the node resamples via torchaudio, and if it isn't in ComfyUI's environment you get "Resampling dialogue/SFX needs torchaudio." ComfyUI usually has it; portable builds sometimes don't.
  • Expecting a transition. Hard cuts only. Transitions and more than two effects aren't implemented.
  • Trusting the duck. Level-based ducking can't tell a door slam from a line of dialogue. Export, listen, adjust.

Wire the output into KIE • Save Video (writes to output/KIE-Videos/) or KIE • Preview Video to check it in the graph. The pack's templates/finish-video-with-music.json shows the whole chain if you'd rather read than wire.

CategoryKIE Next/Studio/Production

Inputs (14)

NameTypeDefaultDescription
video_1VIDEO—
musicAUDIO—
music_gain_dbFLOAT-6.0-48–12—
short_musicCOMBOpad silence2 options: pad silence, loop with crossfade
fade_secondsFLOAT1.00–10—
video_2optVIDEO—
video_3optVIDEO—
video_4optVIDEO—
dialogue_audiooptAUDIO—
dialogue_duck_dboptFLOAT12.00–30—
sfx_1optAUDIO—
sfx_1_time_secondsoptFLOAT0.00–3600—
sfx_2optAUDIO—
sfx_2_time_secondsoptFLOAT0.00–3600—

Outputs (2)

NameTypeDescription
videoVIDEO—
assembly_report_jsonSTRING—