SAM-Audio Span Separate
Text plus time, when a description isn't enough
- pipeline
- audio
- spans
- target
- residual
This is the precision variant of the pack's text separator. Same model, same diffusion separation, same two audio outputs - but it takes a SAM_AUDIO_SPANS chain in alongside the description, so you can tell the model exactly where in the timeline the target lives. If the Text Separate node is your first attempt, this is the upgrade you reach for when the first attempt grabs the wrong sound.
How it works
Mechanically it's the text separator plus one more input. Your description ("car honking", "man speaking") conditions the separation, and the spans you built with SAM-Audio Span Prompt constrain when the model is allowed to find it. Positive spans are where the target is present; negative spans are where it isn't. The node validates your spans against the actual clip duration before it does anything, so a span that hangs past the end of the audio is clipped, not an error.
The rest of the inputs are shared with every separator in the pack, and they're the ones worth knowing:
seed- SAM-Audio starts from noise, so the seed controls reproducibility. Same seed, same audio, same description, same spans → same separation. Bump it when you want a different take.inference_steps- 32 by default, 2–128. More steps is slower and usually cleaner; for a quick preview, 16 is a fine starting point.chunk_duration/chunk_overlap- long audio is cut into overlapping chunks and stitched back with a normalized crossfade (10-second chunks, 1-second overlap by default). Setchunk_durationto0to process the whole clip in one pass - simpler, but that's how you OOM on a long file.
The two outputs, target and residual, are what every separator gives you: the isolated sound you asked for, and everything that was left over. Wire both into PreviewAudio or a save node - hearing the residual is genuinely useful, because if your target leaks into it, your spans are off.
When to use it over the text node
Use spans when your mixture is doing something structured: a podcast where a second guest talks over your target, a song where the instrument you want is silent in the middle, a field recording with a truck that rumbles through for a few seconds. Describing "car honking" gets you the honks everywhere; adding a positive span over just the section you care about stops the model from chasing the far-away one.
The reverse move - a negative span where the target isn't - is the one people underuse. If the model keeps separating a similar-sounding instrument that only appears in one section, a negative span there is your cleanest fix.
Common issues
- Wrong chunk settings. For a clip under ~10 seconds the default chunking is moot. For anything longer, remember
chunk_duration: 0is your "whole clip, one pass" switch, and the 1-second overlap is the crossfade glue, not a detail to zero out. - Spans with a text-only model. If you picked a non-
-tvcheckpoint you're fine - spans work on all variants, unlike visual prompting. The loader defaults tolarge, which handles all of it. - The download wall. First run downloads the checkpoint (5–15 GB depending on model) and the pinned T5 encoder. It's a one-time cost, and the node looks frozen while it happens - watch the console.
Install via ComfyUI Manager (search "ComfyUI-SAM-Audio") or the git clone + install.py route from the pack README.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| pipeline | SAM_AUDIO_PIPELINE | — | |
| audio | AUDIO | — | |
| description | STRING | car honking | — |
| spans | SAM_AUDIO_SPANS | — | |
| seed | INT | 00–18446744073709550000 | Controls SAM-Audio's initial noise for reproducible separation. |
| inference_steps | INT | 322–128 | Number of midpoint function evaluations. Higher values are slower and may improve quality. |
| chunk_duration | FLOAT | 10.00–3600 | Seconds processed per pass. Use 0 to process the entire clip at once. |
| chunk_overlap | FLOAT | 1.00–60 | Seconds shared by adjacent chunks for a smooth crossfade. |
| reranking_candidatesopt | INT | 11–8 | Generate multiple candidates and select one with Meta's Judge. Values above 1 lazily download and load the optional Judge model. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| target | AUDIO | — |
| residual | AUDIO | — |