Nodes/comfyui-AGSoft/🎬✂️AGSoft Video Split
ComfyUI Node

🎬✂️AGSoft Video Split

Cut a fragment out of a video, fast or frame-accurate

By Art-xmaster·Created about a year ago·Updated 2 days ago· 25
🎬✂️AGSoft Video Split
  • video
  • audio
  • video_path
  • duration_seconds
  • duration_timecode
  • file_size_mb
  • width
  • height
  • fps
  • frames_est
output_namesplit_video.mp4
output_path
video_path
cut_modefast
start_time0.0
end_time0.0
audio_sourcekeep
audio_path
audio_modefit
audio_volume1.00
audio_fade_in0.0
audio_fade_out0.0
encoder_modeauto
quality_presetbalanced

🎬✂️AGSoft Video Split cuts a fragment out of a video by start_time / end_time, with the same fast-vs-precise trade-off as the audio splitter. It's the "give me the good 10 seconds" node, and it doubles as a lightweight audio-swapper if the clip you cut needs different sound.

The core choice is cut_mode:

  • fast - stream copy. The video packets are copied without re-encoding, so it's instant and lossless - but the cut snaps to a keyframe, meaning the start may land a few frames earlier or later than your exact start_time. Endpoint nudging is the price of speed.
  • precise - re-encode. Frame-accurate cut, costs an encode pass. This is the one you want when the cut point is on a word or a motion beat.

If the fragment is a whole clip or a scene you'll reuse, fast is almost always right. If you're trimming to the frame for a cut that has to land perfectly, precise is worth the wait.

The bonus: replacing the audio while you're here

audio_source defaults to keep (the original track is cut along with the video). Set it to replace and the node will mux in a new track instead: audio_path (a file, priority) or the audio AUDIO input, with audio_mode (fit - trim/pad to the fragment length, or loop - repeat across it), audio_volume, audio_fade_in, and audio_fade_out. That makes this a one-stop "trim and re-dub" node for short clips. The encoder_mode / quality_preset controls only matter in precise mode (or when replacing audio) since fast doesn't re-encode.

Source video comes from the optional video input (priority) or video_path.

Outputs

The standard pack video set: video_path (STRING), duration_seconds, duration_timecode, file_size_mb, width, height, fps, frames_est. Empty output_pathComfyUI/output.

Install

Part of the comfyui-AGSoft pack. ComfyUI Manager → search "comfyui-AGSoft" → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Art-xmaster/comfyui-AGSoft

Restart. No models; it drives the bundled FFmpeg (or a system ffmpeg on PATH).

The classic mistake is expecting fast mode to hit start_time to the frame. It won't - keyframe snapping is inherent to stream copy. If the exact frame matters, switch to precise. And if fast fails on a source with unusual keyframe spacing, precise will get you the cut; it's the reliable fallback for every edge case.

CategoryAGSoft/Video

Inputs (16)

NameTypeDefaultDescription
output_nameSTRINGsplit_video.mp4Output filename. The extension is kept as entered (.mp4 by default). --- Имя итогового файла. Расширение сохраняется как введено (по умолчанию .mp4).
output_pathSTRINGOutput directory. If empty, ComfyUI/output is used. --- Папка сохранения. Если пусто, используется ComfyUI/output.
video_pathSTRINGPath to the source video. Used only if video input is not connected. --- Путь к исходному видео. Используется, только если вход video не подключен.
cut_modeCOMBOfastfast = stream copy, cut by keyframes (quick, no re-encode, start snaps to a keyframe). precise = re-encode, frame-accurate cut. --- fast = stream copy, резка по ключевым кадрам (быстро, старт привязан к ключевому кадру). precise = перекод, покадрово точная резка.
start_timeFLOAT0.00–86400Fragment start in seconds. 0 = from the beginning. / Начало фрагмента. 0 = с начала.
end_timeFLOAT0.00–86400Fragment end in seconds. 0 = to the end. / Конец фрагмента. 0 = до конца.
audio_sourceCOMBOkeepkeep = keep the original audio track (cut together with the video). replace = overlay a new track from audio_path / audio input. mute = no audio. --- keep = оставить родную дорожку (режется вместе с видео). replace = наложить новую дорожку из audio_path / входа audio. mute = без звука.
audio_pathSTRINGPath to the new audio (used only when audio_source=replace). Takes priority over the audio input. --- Путь к новому аудио (только при audio_source=replace). Приоритет над входом audio.
audio_modeCOMBOfitOnly when audio_source=replace. fit = trim/pad silence to the fragment length. loop = loop the new track across the fragment. --- Только при audio_source=replace. fit = обрезать/добить тишиной под длину фрагмента. loop = зациклить новую дорожку под фрагмент.
audio_volumeFLOAT1.000–2New track volume (replace only). 1.0 = original. / Громкость новой дорожки (только replace). 1.0 = оригинал.
audio_fade_inFLOAT0.00–60New track fade-in (replace only). / Появление новой дорожки (только replace).
audio_fade_outFLOAT0.00–60New track fade-out (replace only). / Затухание новой дорожки (только replace).
encoder_modeCOMBOautoUsed only in precise mode. auto = NVENC if available, otherwise CPU. --- Только в режиме precise. auto = NVENC, если доступен, иначе CPU.
quality_presetCOMBObalancedEncoding quality (precise mode only). / Качество кодирования (только precise).
videooptVIDEOOptional source video from ComfyUI. Has priority over video_path. --- Опциональное исходное видео из ComfyUI. Имеет приоритет над video_path.
audiooptAUDIOOptional new voiceover (used only when audio_source=replace and audio_path is empty). --- Опциональная новая озвучка (только при audio_source=replace и пустом audio_path).

Outputs (8)

NameTypeDescription
video_pathSTRING
duration_secondsFLOAT
duration_timecodeSTRING
file_size_mbFLOAT
widthINT
heightINT
fpsFLOAT
frames_estINT