Custom nodes for using SAM-Audio (Segment Anything Model for Audio) in ComfyUI.
Separate specific sounds from audio using text, visual (video + mask), or time span prompts.
| Node | Description |
|---|---|
| SAM-Audio Model Loader | Load SAM-Audio model and processor |
| SAM-Audio Text Separate | Separate sound by text description (e.g., "A person speaking") |
| SAM-Audio Visual Separate | Separate sound associated with visual objects using video and mask |
| SAM-Audio Span Separate | Separate sound by specifying time range (start/end seconds) |
| Save Audio | Save separated audio to file |
cd /path/to/ComfyUI
git clone https://github.com/facebookresearch/sam-audio.git
# Activate your ComfyUI virtual environment (e.g., ~/venv/comfy)
source ~/venv/comfy/bin/activate
# Install core dependencies
pip install einops torchdiffeq audiobox_aesthetics huggingface_hub xformers
# Install dacvae
pip install git+https://github.com/facebookresearch/dacvae.git
# Install perception_models (provides core.audio_visual_encoder)
pip install git+https://github.com/facebookresearch/perception_models@unpin-deps --no-deps
# Install ImageBind (required for Visual Ranker)
pip install git+https://github.com/facebookresearch/ImageBind.git
# Install LAION-CLAP (required for Text Ranker)
pip install laion-clap
huggingface-cli login
cd ComfyUI/custom_nodes
git clone https://github.com/t22m003/ComfyUI-sam-audio.git
Note: This custom node requires the
sam-audiorepository to be present atComfyUI/sam-audio. The node imports thesam_audiomodule from this location.
SAM-Audio Model LoaderLoad AudioSAM-Audio Text Separate and describe the sound to isolateSave AudioSAM-Audio Span Separate and specify start/end secondsSAM-Audio Visual SeparateSample workflow files are included in the examples/ directory:
CLIPSeg from ComfyUI-Essentials and Video Combine from VideoHelperSuite)To use: Load the workflow JSON file in ComfyUI (drag & drop or File → Load).
The following models are automatically downloaded from HuggingFace:
facebook/sam-audio-smallfacebook/sam-audio-basefacebook/sam-audio-large (recommended)facebook/sam-audio-small-tv (for Visual Prompting)facebook/sam-audio-base-tvfacebook/sam-audio-large-tvTo use locally downloaded models, place them in the models/sam_audio/ directory:
ComfyUI/
models/
sam_audio/
my-model/ # Model name (any name)
config.json # Required
checkpoint.pt # Required
Once properly placed, the model will be available as local/my-model in the node.
Note: Models downloaded from HuggingFace are typically cached in
~/.cache/huggingface/hub/. You can copy or symlinkmodels--facebook--sam-audio-large/snapshots/<hash>/from that directory tomodels/sam_audio/sam-audio-large/for offline usage.
This custom node uses SAM-Audio.
SAM-Audio is subject to Meta's "SAM License". Key restrictions:
See SAM License for details.
1 commits
Python
100.0%
Custom nodes for using SAM-Audio (Segment Anything Model for Audio) in ComfyUI.
Separate specific sounds from audio using text, visual (video + mask), or time span prompts.
| Node | Description |
|---|---|
| SAM-Audio Model Loader | Load SAM-Audio model and processor |
| SAM-Audio Text Separate | Separate sound by text description (e.g., "A person speaking") |
| SAM-Audio Visual Separate | Separate sound associated with visual objects using video and mask |
| SAM-Audio Span Separate | Separate sound by specifying time range (start/end seconds) |
| Save Audio | Save separated audio to file |
cd /path/to/ComfyUI
git clone https://github.com/facebookresearch/sam-audio.git
# Activate your ComfyUI virtual environment (e.g., ~/venv/comfy)
source ~/venv/comfy/bin/activate
# Install core dependencies
pip install einops torchdiffeq audiobox_aesthetics huggingface_hub xformers
# Install dacvae
pip install git+https://github.com/facebookresearch/dacvae.git
# Install perception_models (provides core.audio_visual_encoder)
pip install git+https://github.com/facebookresearch/perception_models@unpin-deps --no-deps
# Install ImageBind (required for Visual Ranker)
pip install git+https://github.com/facebookresearch/ImageBind.git
# Install LAION-CLAP (required for Text Ranker)
pip install laion-clap
huggingface-cli login
cd ComfyUI/custom_nodes
git clone https://github.com/t22m003/ComfyUI-sam-audio.git
Note: This custom node requires the
sam-audiorepository to be present atComfyUI/sam-audio. The node imports thesam_audiomodule from this location.
SAM-Audio Model LoaderLoad AudioSAM-Audio Text Separate and describe the sound to isolateSave AudioSAM-Audio Span Separate and specify start/end secondsSAM-Audio Visual SeparateSample workflow files are included in the examples/ directory:
CLIPSeg from ComfyUI-Essentials and Video Combine from VideoHelperSuite)To use: Load the workflow JSON file in ComfyUI (drag & drop or File → Load).
The following models are automatically downloaded from HuggingFace:
facebook/sam-audio-smallfacebook/sam-audio-basefacebook/sam-audio-large (recommended)facebook/sam-audio-small-tv (for Visual Prompting)facebook/sam-audio-base-tvfacebook/sam-audio-large-tvTo use locally downloaded models, place them in the models/sam_audio/ directory:
ComfyUI/
models/
sam_audio/
my-model/ # Model name (any name)
config.json # Required
checkpoint.pt # Required
Once properly placed, the model will be available as local/my-model in the node.
Note: Models downloaded from HuggingFace are typically cached in
~/.cache/huggingface/hub/. You can copy or symlinkmodels--facebook--sam-audio-large/snapshots/<hash>/from that directory tomodels/sam_audio/sam-audio-large/for offline usage.
This custom node uses SAM-Audio.
SAM-Audio is subject to Meta's "SAM License". Key restrictions:
See SAM License for details.
1 commits
Python
100.0%