🎬✂️AGSoft Video Split
Cut a fragment out of a video, fast or frame-accurate
- video
- audio
- video_path
- duration_seconds
- duration_timecode
- file_size_mb
- width
- height
- fps
- frames_est
🎬✂️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 exactstart_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_path → ComfyUI/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.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| output_name | STRING | split_video.mp4 | Output filename. The extension is kept as entered (.mp4 by default). --- Имя итогового файла. Расширение сохраняется как введено (по умолчанию .mp4). |
| output_path | STRING | Output directory. If empty, ComfyUI/output is used. --- Папка сохранения. Если пусто, используется ComfyUI/output. | |
| video_path | STRING | Path to the source video. Used only if video input is not connected. --- Путь к исходному видео. Используется, только если вход video не подключен. | |
| cut_mode | COMBO | fast | fast = 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_time | FLOAT | 0.00–86400 | Fragment start in seconds. 0 = from the beginning. / Начало фрагмента. 0 = с начала. |
| end_time | FLOAT | 0.00–86400 | Fragment end in seconds. 0 = to the end. / Конец фрагмента. 0 = до конца. |
| audio_source | COMBO | keep | keep = 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_path | STRING | Path to the new audio (used only when audio_source=replace). Takes priority over the audio input. --- Путь к новому аудио (только при audio_source=replace). Приоритет над входом audio. | |
| audio_mode | COMBO | fit | Only 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_volume | FLOAT | 1.000–2 | New track volume (replace only). 1.0 = original. / Громкость новой дорожки (только replace). 1.0 = оригинал. |
| audio_fade_in | FLOAT | 0.00–60 | New track fade-in (replace only). / Появление новой дорожки (только replace). |
| audio_fade_out | FLOAT | 0.00–60 | New track fade-out (replace only). / Затухание новой дорожки (только replace). |
| encoder_mode | COMBO | auto | Used only in precise mode. auto = NVENC if available, otherwise CPU. --- Только в режиме precise. auto = NVENC, если доступен, иначе CPU. |
| quality_preset | COMBO | balanced | Encoding quality (precise mode only). / Качество кодирования (только precise). |
| videoopt | VIDEO | Optional source video from ComfyUI. Has priority over video_path. --- Опциональное исходное видео из ComfyUI. Имеет приоритет над video_path. | |
| audioopt | AUDIO | Optional new voiceover (used only when audio_source=replace and audio_path is empty). --- Опциональная новая озвучка (только при audio_source=replace и пустом audio_path). |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| video_path | STRING | — |
| duration_seconds | FLOAT | — |
| duration_timecode | STRING | — |
| file_size_mb | FLOAT | — |
| width | INT | — |
| height | INT | — |
| fps | FLOAT | — |
| frames_est | INT | — |