OpenShot-ComfyUI
OpenShot-ComfyUI provides production-focused ComfyUI nodes built for OpenShot integration, with a strong focus on reliable SAM2 workflows for longer videos.
The goal is simple: make advanced segmentation and video analysis features feel native inside OpenShot's UI, while keeping the underlying Comfy graphs stable, predictable, and memory-safe.
Why this exists
OpenShot needs SAM2 pipelines that can handle real-world clips, not just short demos.
Many SAM2 custom-node workflows process or retain full-video state in ways that become fragile or memory-heavy as clip length grows. In practice, that can lead to slowdowns, failures, or OOM behavior on longer timelines.
This project addresses that gap with chunk-oriented processing designed specifically for OpenShot's planned UI integration path.
How this works
- Keep node interfaces close to standard ComfyUI types and patterns.
- Process video segmentation in bounded chunks instead of retaining full-video mask history.
- Return outputs that are easier for OpenShot to consume and orchestrate in larger editing workflows.
- Include practical companion nodes (GroundingDINO + TransNetV2) that support automated, timeline-aware tooling.
What this includes (V1)
OpenShotDownloadAndLoadSAM2ModelOpenShotSam2Segmentation(single-image)OpenShotSam2VideoSegmentationAddPointsOpenShotSam2VideoSegmentationChunked(meta-batch/chunk friendly)OpenShotGroundingDinoDetect(text-prompted object detection -> mask + JSON)OpenShotTransNetSceneDetect(direct TransNetV2 inference -> IN/OUT JSON ranges)OpenShotDeepFilterNetDenoiseAudio(file-path based audio denoise -> FLAC path)OpenShotAudioSRClarity(isolated AudioSR runner -> FLAC path)
Attribution
This project is inspired by and partially based on ideas and APIs from:
kijai/ComfyUI-segment-anything-2- Meta SAM2 research/code
Please see upstream projects for full original implementations and credits.
Requirements
- ComfyUI
- PyTorch (as used by your Comfy install)
ffmpegandffprobeavailable on yourPATH
Install this node pack into ComfyUI/custom_nodes/OpenShot-ComfyUI and restart ComfyUI.
Quick install (copy/paste)
Install this node pack's Python dependencies:
python -m pip install -r requirements.txt
Install SAM2 separately:
python -m pip install --no-build-isolation git+https://github.com/facebookresearch/sam2.git
Validate the environment:
python validate.py
Restart ComfyUI after install.
validate.py supports two cases:
- On a regular laptop/dev environment, it validates the Python packages plus
ffmpeg/ffprobe - Inside the actual ComfyUI Python environment, it also validates Comfy imports and node registration
If you run it in the ComfyUI environment and it passes, restart ComfyUI and the nodes should load.
SAM2 is installed separately on purpose. Keeping it out of requirements.txt makes the normal dependency install much more reliable and avoids long hangs during pip's build-isolation step.
First-use model downloads
OpenShotDownloadAndLoadSAM2Modeldownloads supported SAM2 checkpoints intoComfyUI/models/sam2on first use.OpenShotGroundingDinoDetectdownloads model weights from Hugging Face on first use and uses the normal HF cache.OpenShotDeepFilterNetDenoiseAudiodownloads the defaultDeepFilterNet3model on first use using DeepFilterNet's cache directory.OpenShotAudioSRClaritycreates an isolated local venv on first use, installs AudioSR there, and then downloads the selected AudioSR checkpoint from Hugging Face on first run.OpenShotTransNetSceneDetectdoes not require a separate manual weight download from this node pack.
Audio denoise node
OpenShotDeepFilterNetDenoiseAudio is intentionally minimal:
- Input:
source_audio_path,noise_reduction,keep_model_loaded - Output: a new FLAC file path
- The node uses the upstream DeepFilterNet package and blends the enhanced result with the original signal using
noise_reductionfrom0.0to1.0 0.0means "keep the original audio" and still emits a FLAC copy1.0means "full denoise"
The node accepts typical audio formats that ffmpeg can decode and always writes a new .flac file into ComfyUI's output folder under openshot_audio/.
Audio clarity node
OpenShotAudioSRClarity is intended for low-fidelity or bandwidth-limited audio:
- Input:
source_audio_pathoraudio,model_name,keep_model_loaded - Output: a new FLAC file path
model_name=speechis intended for spoken voicemodel_name=basicis intended for music and sound effects
AudioSR is intentionally not installed into the main Comfy environment because its package pins older numpy, librosa, and transformers versions. Instead, the node creates and uses an isolated runner environment on first use so the main Comfy environment stays stable.
That means there is no extra install command for AudioSR, but the first Clarity run will take longer while the isolated environment and model checkpoint are prepared.
Validation script
Run:
python validate.py
It checks:
- required Python imports
- DeepFilterNet compatibility through the bundled runner shim
ffmpegandffprobe- ComfyUI-side imports needed for node registration, when ComfyUI is available
- that the expected node classes are present, when ComfyUI is available
Notes
OpenShotSam2VideoSegmentationChunkedreturns only the requested chunk range (bounded memory) instead of collecting whole-video masks.- For very long videos, pair chunked outputs with batch-safe downstream nodes (VHS meta-batch, staged processing, or on-disk intermediates).
torchaudiois listed explicitly because DeepFilterNet imports it internally and some environments do not pull it in automatically.- AudioSR uses a separate on-demand runner environment to avoid downgrading shared Comfy dependencies.
Copyright (C) 2026 OpenShot Studios, LLC
Licensed under the GNU General Public License v3.0 (GPLv3). See LICENSE.md for the full license text.